# @a11y-kit/utils

Badge displaying current bundle size Badge displaying current release Badge displaying weekly downloads Badge displaying license Badge displaying types availability

A suite of utils to aid accessible development. Used primarily by other packages in the @a11y-kit namespace, but feel free to use directly in your projects.

# Installation

yarn add @a11y-kit/utils


npm i @a11y-kit/utils

# Usage

import { orderNodes } from '@a11y-kit/utils`

# Available utils

# orderNodes

Orders an array of Nodes by document position. Used when handling many nodes and you want to make sure you are interacting with them in the correct order.

import { orderNodes } from '@a11y-kit/utils'

const foo = document.getElementById('foo')
const bar = document.getElementById('bar')

const sorted = [foo, bar].sort(orderNodes)