# circular-at

> Access array items at any positive or negative index. If the index is out of bounds, it will be wrapped around the length of the array.

Latest version **1.0.4** (published 2017-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install circular-at
pnpm add circular-at
yarn add circular-at
bun add circular-at
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-06-08 |
| First published | 2016-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bjoerge |
| Keywords | array, index, nth, circular, cyclic, negative, at |

## Links

- npm: https://www.npmjs.com/package/circular-at
- Repository: https://github.com/bjoerge/circular-at
- Homepage: https://github.com/bjoerge/circular-at#readme
- Issues: https://github.com/bjoerge/circular-at/issues
- npm.io page: https://npm.io/package/circular-at

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2017-06-08
- 1.0.3 — 2016-11-01
- 1.0.2 — 2016-11-01
- 1.0.1 — 2016-10-04
- 1.0.0 — 2016-10-04

## README

# circular-at

Access array items at any positive or negative index. If the index is out of bounds, it will be wrapped around the length of the array.

## For example:

```js
import at from 'circular-at'

const array = ['a', 'b', 'c']

at(array, 0) === 'a'
at(array, 1) === 'b'
at(array, 2) === 'c'
at(array, 3) === 'a'
at(array, 4) === 'b'
at(array, 5) === 'c'

// ... and so on
```

This goes for negative indices as well:
```js
at(array, -1) === 'c'
at(array, -2) === 'b'
at(array, -3) === 'a'
at(array, -4) === 'c'
at(array, -5) === 'b'

// ... and so on
```

If the given value is not an array, it behaves like `value[index]`

## Install
```
npm install circular-at
```

## License
MIT

---
_Source: https://npm.io/package/circular-at · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
