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

https://github.com/threepointone/at

at(o, path) and setAt(o, path, value)
https://github.com/threepointone/at

Last synced: 2 months ago
JSON representation

at(o, path) and setAt(o, path, value)

Awesome Lists containing this project

README

        

# at

safe object access

## Installation

$ component install threepointone/at

## API
```js
var at = require('at').at;
var setAt = require('at').setAt;

var o = {
a:{
b:1
}
};

console.log(at(o, 'a.b'));
// 1

console.log(at(o, 'a.b.c'));
//undefined

setAt(o, 'a.b.c.d.e', 'magic');

console.log(o.a.b.c.d);
// { e:'magic' }

```

## Tests (pending)
install dependencies -
```
npm install
```
then
```
npm test
```

## License

MIT