Utils

Utilities.

Usage

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

utils

Namespace containing utilities.

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

The namespace has the following sub-namespaces:

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 ) );
Did you find this page helpful?