# @ish_/path-pointer

> Create fast getter/setter precompiled functions pointing to path destination

Latest version **0.0.1** (published 2022-06-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install @ish_/path-pointer
pnpm add @ish_/path-pointer
yarn add @ish_/path-pointer
bun add @ish_/path-pointer
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2022-06-18 |
| First published | 2022-06-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Vladislav Pavlov |
| Maintainers | ish- |
| Keywords | path, precompiled, get, getter, set, setter, fast, pointer, es6 module, lodash |

## Links

- npm: https://www.npmjs.com/package/@ish_/path-pointer
- Repository: https://github.com/ish-/path-pointer
- Homepage: https://github.com/ish-/path-pointer#readme
- Issues: https://github.com/ish-/path-pointer/issues
- npm.io page: https://npm.io/package/@ish_/path-pointer

## 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

- 0.0.1 (latest) — 2022-06-18

## README

## PathPointer · 
Create fast getter/setter functions precompiled with `new Function()`, pointing to path destination.

Precompiling takes perceptible performance growth if you use these once binded functions many times. Look at `./profiling.js` where it is compared with `lodash` versions. "READY" functions are 7-20x faster. Obviously, "cold" way are only 3x slower cause of compiling time. So use it right cases :)

### Usage
```
import PathPointer, { createGetter, createSetter } from '@ish_/path-pointer';
const obj = {};

const set = createSetter(obj, 'one.two[1].value', 1);
set(true);
// expect(obj.one.two[1].value).toBe(true);

const get = createGetter(obj, 'one.two[1].value');
const value = get();
// expect(value).toBe(true);

const path = 'items['id123'].value';
const pp = new PathPointer(obj, path);
set('pushed');
const pushedValue = p.get();
// expect(pushedValue).toBe('pushed');
```

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