# data-path-finder

> Library and CLI tool to find properties of a JSON data structure using datapath string

Latest version **0.0.4** (published 2020-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install data-path-finder
pnpm add data-path-finder
yarn add data-path-finder
bun add data-path-finder
```

## 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.4 |
| Published | 2020-10-17 |
| First published | 2020-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jose A. Nunez and Jerome D. Yackley |
| Maintainers | janunezc, jerome.yackley |
| Keywords | util, functional, server, client, browser |

## Links

- npm: https://www.npmjs.com/package/data-path-finder
- Repository: https://github.com/jeromeyackley/data-path-finder
- Homepage: https://github.com/jeromeyackley/data-path-finder#readme
- Issues: https://github.com/jeromeyackley/data-path-finder/issues
- npm.io page: https://npm.io/package/data-path-finder

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2020-10-17
- 0.0.3 — 2020-10-16
- 0.0.2 — 2020-10-16
- 0.0.1 — 2020-10-16

## README

# data-path-finder
This library allows for traversing a javascript object to find particular properties specified in a data-path string.

A data-path string provides the ability to specify an object-traversal mechanism to grab specific attribute values out of the provided object.

# Data Path specification
A data-path string conforms to a simple specification of a property tree.

Consider the following javascript object:
```
{
  userName:"Jose",
  address: "San Pablo de Heredia",
  favoriteCars: [ 
    {
      make:"Nissan",
      model:"versa"
    },
    {
      make:"Toyota",
      model:"Rav4"
    },
    {
      make:"Hyundai",
      model:"Santa Fe"
    }
  ]
}
```

The data-path specification `"userName"` points to the value "Jose", while the data-path specification `"favoriteCars[].make"` point to the value `["Nissan","Toyota","Hyundai"]`

# Uses of this library
Known uses for data-path expressions implemented in this library include data transformation, mapping and verification out of dynamic rules specified in text. For example for comparing two objects of different structure that may have common attributes.

# Example using the cli.js file
1. In an empty directory, run `npm install data-path-finder`
2. Then run `cd node_modules/data-path-finder/src`
3. Then run `node cli.js "../es_samples/favoriteCars.json" "favoriteCars[].make"
4. The command should display a result of `["Nissan","Toyota","Hyundai"]`

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