Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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 */);
```