https://github.com/igorskyflyer/npm-uarray
π Provides UArray, an Array type that supports negative indices/indexes, just wrap your regular JavaScript array with UArray() and you are all set! π
https://github.com/igorskyflyer/npm-uarray
access array back-end igorskyflyer index javascript mocha negative nodejs npm uarray utility
Last synced: about 2 months ago
JSON representation
π Provides UArray, an Array type that supports negative indices/indexes, just wrap your regular JavaScript array with UArray() and you are all set! π
- Host: GitHub
- URL: https://github.com/igorskyflyer/npm-uarray
- Owner: igorskyflyer
- License: mit
- Created: 2021-07-05T00:02:58.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-08-28T01:24:07.000Z (10 months ago)
- Last Synced: 2025-09-04T08:18:46.504Z (10 months ago)
- Topics: access, array, back-end, igorskyflyer, index, javascript, mocha, negative, nodejs, npm, uarray, utility
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@igorskyflyer/uarray
- Size: 199 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
UArray
π Provides UArray, an Array type that supports negative indices/indexes, just wrap your regular JavaScript array with UArray() and you are all set! π
## π Table of Contents
- [Features](#-features)
- [Usage](#-usage)
- [Examples](#οΈ-examples)
- [Changelog](#-changelog)
- [Support](#-support)
- [License](#-license)
- [Related](#-related)
- [Author](#-author)
## π€ Features
- π’ Negative indexing (-1, -2, etc.)
- π§³ Accepts array or multiple values
- πͺ Behaves like a native array
- π οΈ Supports all standard methods
- π§Ό Safe fallback for non-numeric keys
- π§ͺ Ideal for reverse access and testing
- π Drop-in replacement, zero config
## π΅πΌ Usage
Install it by executing any of the following, depending on your preferred package manager:
```bash
pnpm add @igorskyflyer/uarray
```
```bash
yarn add @igorskyflyer/uarray
```
```bash
npm i @igorskyflyer/uarray
```
> βΉοΈ
> Uses the built-in `Proxy` object, check browser compatibility on the [Can I Use](https://caniuse.com/proxy) website.
>
## ποΈ Examples
```js
import { UArray } from '@igorskyflyer/uarray'
const food = UArray(['π', 'π', 'πΏ', 'π₯', 'π₯']) // array passed
const objects = UArray('π', 'π©', 'β½', 'π₯', 'π―') // no array passed, just direct values
console.log(food[-1]) // prints 'π₯'
console.log(food[-3]) // prints 'πΏ'
console.log(objects[-1]) // prints 'π―'
console.log(objects[-3]) // prints 'β½'
```
## π Changelog
π The changelog is available here, [CHANGELOG.md](https://github.com/igorskyflyer/npm-uarray/blob/main/CHANGELOG.md).
## πͺͺ License
Licensed under the MIT license which is available here, [MIT license](https://github.com/igorskyflyer/npm-uarray/blob/main/LICENSE).
## π Support
I work hard for every project, including this one and your support means a lot to me!
Consider buying me a coffee. β
Thank you for supporting my efforts! ππ
## 𧬠Related
[@igorskyflyer/str-is-in](https://www.npmjs.com/package/@igorskyflyer/str-is-in)
> _π§΅ Provides ways of checking whether a String is present in an Array of Strings using custom Comparators. π_
[@igorskyflyer/keppo](https://www.npmjs.com/package/@igorskyflyer/keppo)
> _π‘ Parse, manage, compare and output SemVer-compatible version numbers. π‘_
[@igorskyflyer/chars-in-string](https://www.npmjs.com/package/@igorskyflyer/chars-in-string)
> _πͺ Provides ways of testing whether an array of chars is present inside a given String. β_
[@igorskyflyer/clone](https://www.npmjs.com/package/@igorskyflyer/clone)
> _𧬠A lightweight JavaScript utility allowing deep copy-by-value of nested objects, arrays and arrays of objects. πͺ_
[@igorskyflyer/common-color](https://www.npmjs.com/package/@igorskyflyer/common-color)
> _π¨ Provides common Color-related TypeScript types. π_
## π¨π»βπ» Author
Created by **Igor DimitrijeviΔ** ([*@igorskyflyer*](https://github.com/igorskyflyer/)).