# array-initial

> Get all but the last element or last n elements of an array.

Latest version **1.1.0** (published 2017-12-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install array-initial
pnpm add array-initial
yarn add array-initial
bun add array-initial
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2017-12-05 |
| First published | 2014-12-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/array-initial) |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jon Schlinkert |
| Maintainers | phated, doowb, jonschlinkert |
| Keywords | array, fast, first, initial, javascript, js, last, rest, util, utility, utils |

## Links

- npm: https://www.npmjs.com/package/array-initial
- Repository: https://github.com/jonschlinkert/array-initial
- Issues: https://github.com/jonschlinkert/array-initial/issues
- npm.io page: https://npm.io/package/array-initial

## Dependencies (2)

- [is-number](https://npm.io/package/is-number.md) ^4.0.0
- [array-slice](https://npm.io/package/array-slice.md) ^1.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.0 (latest) — 2017-12-05
- 1.0.1 — 2017-08-02
- 1.0.0 — 2014-12-12

## README

# array-initial [![NPM version](https://badge.fury.io/js/array-initial.svg)](http://badge.fury.io/js/array-initial)

> Get all but the last element or last n elements of an array.

## Install with [npm](npmjs.org)

```bash
npm i array-initial --save
```

## Usage

```js
var initial = require('array-initial');

initial(['a', 'b', 'c', 'd', 'e', 'f']);
//=> ['a', 'b', 'c', 'd', 'e']

initial(['a', 'b', 'c', 'd', 'e', 'f'], 1);
//=> ['a', 'b', 'c', 'd', 'e']

initial(['a', 'b', 'c', 'd', 'e', 'f'], 2);
//=> ['a', 'b', 'c', 'd']
```

## Author

**Jon Schlinkert**
 
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) 

## License
Copyright (c) 2014 Jon Schlinkert  
Released under the MIT license

***

_This file was generated by [verb](https://github.com/assemble/verb) on December 12, 2014. To update, run `npm i -g verb && verb`._

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