lense

0.0.3 • Public • Published

Lenses for javascript.

Minimal, and no external dependencies (except for building/testing).

Licensing

See the license for licensing.

Example

var Lense = require('lense').Lense
lense = Lense.parse('foo.bar[1].a')

obj = {
  "foo": {
    "bar": [
      1,
      { "a": 2 }
    ]
  }
}

console.log(lense.get(obj)) // > 2
lense.set(obj, 4000)
console.log(lense.get(obj)) // > 4000

Documentation

See the source for more documentation.

Readme

Keywords

Package Sidebar

Install

npm i lense

Weekly Downloads

2

Version

0.0.3

License

MIT

Last publish

Collaborators

  • andyscott