# nasa-keypath

> New Age Keypath Traversal Technology.

Latest version **0.0.1** (published 2013-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install nasa-keypath
pnpm add nasa-keypath
yarn add nasa-keypath
bun add nasa-keypath
```

## 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.0.1 |
| Published | 2013-10-15 |
| First published | 2013-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Nijiko Yonskai |
| Maintainers | nijikokun |
| Keywords | traversal, traverse, keypath, path, array, object, set, get, remove, dot, notation, notation, dot, nasa, module, key, keys, manipulation, string |

## Links

- npm: https://www.npmjs.com/package/nasa-keypath
- Repository: git@github.com:Nijikokun/nasa-keypath
- npm.io page: https://npm.io/package/nasa-keypath

## 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) — 2013-10-15

## README

# NASA Keypath Module

New Age Keypath Traversal Technology. Traverse and manipulate Objects with ease using the newfangled string dot notation all the kids are raving about!

## Installation

```
npm install nasa-keypath
```

or include `index.js` in your browser.

## Utilization

References

```js
var keypath = require('nasa-keypath');
var on = {
  users: [
    { _id: '290682069820139', password: 'something-unique' },
    { _id: '908164718613492', password: 'something-unique', admin: true }
  ],

  count: {
    total: 2,
    admins: 1
  }
};
```
This code has no real meaning, only to show the power of what keypath can do.

### Functional


```js
// Array Manipulation
keypath.remove(on, 'users.[].password'); // No more passwords, safe to show.
keypath.set(on, 'users.[].activated', true); // All users are now activated.
keypath.get(on, 'users.0.admin'); // Is this user authorized?
keypath.get(on, 'users.[].admin', true); // Get all users who are admin, and full object.

// Manipulation
keypath.get(on, 'count.admins');
keypath.set(on, 'count', keypath.get(on, 'users').length); // We can iterate for admins.
```

### OOP

```js
var path = keypath(on);

// Array Manipulation
path.remove('users.[].password'); // No more passwords, safe to show.
path.set('users.[].activated', true); // All users are now activated.
path.get('users.0.admin'); // Is this user an admin?
path.get('users.[].admin', true); // Get all users who are admin, and full object.

// Manipulation
path.get('count.admins'); // 1
path.set('count', path.get('users').length); // We can iterate for admins.
```

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