Skip to content

cobbdb/get-safely

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.


About

Run a block of code safely and quietly.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published