# arrayslice

> A library for creating a virtual array slice using a Proxy to re-map array indicies to the orginal array.

Latest version **0.1.0** (published 2016-08-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install arrayslice
pnpm add arrayslice
yarn add arrayslice
bun add arrayslice
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2016-08-14 |
| First published | 2016-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Lachlan Hunt |
| Maintainers | lachlanhunt |
| Keywords | array, slice, proxy |

## Links

- npm: https://www.npmjs.com/package/arrayslice
- Repository: https://github.com/lachlanhunt/arrayslice
- Homepage: https://github.com/lachlanhunt/arrayslice#readme
- Issues: https://github.com/lachlanhunt/arrayslice/issues
- npm.io page: https://npm.io/package/arrayslice

## Recent versions

- 0.1.0 (latest) — 2016-08-14

## README

Array Slice View
====

A library for creating a virtual array slice using a Proxy to re-map array indicies to the orginal array.

Unlike the native `Array.prototype.slice()` method, this method does not copy any elements from the source array.
Instead, the array is wrapped in a proxy that re-maps get and set calls for numeric array indexes to new positions
based on the given start and end indexes for the slice.


    let a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
    let b = ArraySlice(a, 3, 7);
    console.log([...b]); // 3, 4, 5, 6

    b[0] = 30
    console.log(a); // [0, 1, 2, 30, 4, 5, 6, 7, 8, 9, 10];
    console.log([...b]); // 30, 4, 5, 6

    a.indexOf(4); // 4
    b.indexOf(4); // 1

Warning: You cannot use the methods `push()`, `pop()`, `shift()` and `unshift()` on ArraySlice instances.

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