# arr-rotate

> Rotate all items in an array

Latest version **1.0.0** (published 2018-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install arr-rotate
pnpm add arr-rotate
yarn add arr-rotate
bun add arr-rotate
```

## 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.0 |
| Published | 2018-03-27 |
| First published | 2018-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Kevin Martensson |
| Maintainers | kevva |
| Keywords | array, move, rotate, shift, splice |

## Links

- npm: https://www.npmjs.com/package/arr-rotate
- Repository: https://github.com/kevva/arr-rotate
- Homepage: https://github.com/kevva/arr-rotate#readme
- Issues: https://github.com/kevva/arr-rotate/issues
- npm.io page: https://npm.io/package/arr-rotate

## Recent versions

- 1.0.0 (latest) — 2018-03-27

## README

# arr-rotate [![Build Status](https://travis-ci.org/kevva/arr-rotate.svg?branch=master)](https://travis-ci.org/kevva/arr-rotate)

> Rotate all items in an array


## Install

```
$ npm install arr-rotate
```


## Usage

```js
const arrRotate = require('arr-rotate');

arrRotate(['foo', 'bar', 'unicorn'], 2);
//=> ['bar', 'unicorn', 'foo']

arrRotate(['foo', 'bar', 'unicorn'], 1);
//=> ['unicorn', 'foo', 'bar']

arrRotate(['foo', 'bar', 'unicorn'], -1);
//=> ['bar', 'unicorn', 'foo']
```


## API

### arrRotate(input, num)

#### input

Type: `Array`

Array to rotate.

#### num

Type: `number`<br>
Default: `0`

Number of steps to rotate.


## License

MIT © [Kevin Martensson](https://github.com/kevva)

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