get-safely

1.0.0 • Public • Published

get-safely NPM version

Run a block of code safely and quietly.

$ npm install get-safely

Module is originally created for converted SOAP apis that include many optional attributes that are accessed by indexing.

var get = require('get-safely');
var result = get(function () {
    return some[0].data[0].thatMight.throw('errors');
});

In the example above, if the data exists, then result will equal the expected value. However, if an error occurs while accessing the data, result will equal undefined.


Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    2

Package Sidebar

Install

npm i get-safely

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • cobbdb