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: 3 months 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 (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-27T10:15:57.000Z (over 8 years ago)
- Last Synced: 2025-03-17T13:40:34.760Z (4 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# primitive-path [](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 */);
```