Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vivekimsit/primitive-path
Given an object finds the path to a primitive or array values.
https://github.com/vivekimsit/primitive-path
Last synced: 1 day ago
JSON representation
Given an object finds the path to a primitive or array values.
- Host: GitHub
- URL: https://github.com/vivekimsit/primitive-path
- Owner: vivekimsit
- License: mit
- Created: 2016-11-25T07:26:00.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-27T10:15:57.000Z (about 8 years ago)
- Last Synced: 2024-12-08T12:49:40.846Z (17 days ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# primitive-path [![Build Status](https://api.travis-ci.org/vivekimsit/primitive-path.svg?branch=master)](https://travis-ci.org/vivekimsit/primitive-path)
> Given an object finds the path to a primitive or array values.
## Install
```
$ npm install --save primitive-path
```## Usage
```js
const findPrimitives = require('primitive-path');function log(val, name, path) {
console.log(path.join('.') + '.' + name + '=' + value);
}findPrimitives(deep, log, 'foo' /* opt_name */, ['window'] /* opt path prefix */);
```