Utils

    Standard library utilities.

    Usage

    var utils = require( '@stdlib/utils' );
    

    utils

    Standard library utilities.

    var o = utils;
    // returns {...}
    

    The package contains the following sub-namespaces:

    • async: standard library async utilities.

    Data Structures

    Collections

    Arrays

    Objects

    Functions

    Error Handling

    • trycatch( x, y ): if a function does not throw, return the function return value; otherwise, return y.
    • tryFunction( fcn ): wrap a function in a try/catch block.
    • tryRequire( id ): wrap require in a try/catch block.
    • trythen( x, y ): if a function does not throw, return the function return value; otherwise, return the return value of a second function.

    General Utilities

    Examples

    var objectKeys = require( '@stdlib/utils/keys' );
    var utils = require( '@stdlib/utils' );
    
    console.log( objectKeys( utils ) );