0.2.1 • Published 3 months ago

@stdlib/error-tools v0.2.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

Tools

NPM version Build Status Coverage Status

Error tools.

Installation

npm install @stdlib/error-tools

Usage

var tools = require( '@stdlib/error-tools' );

tools

Namespace containing error tools.

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

The namespace contains the following:

  • database(): standard library error code database.
  • fmtprodmsgFactory( [options] ): return a function which formats an error message for production.
  • fmtprodmsg( code, ...args ): format an error message for production.
  • id2msg( id ): return an error message corresponding to a provided two-character error identifier.
  • id2pkg( id ): return the package name associated with a specified error identifier prefix.
  • msg2id( msg ): return a two-character error identifier corresponding to a provided error message.
  • pkg2id( pkg ): return the error identifier prefix associated with a specified package name.

Examples

var objectKeys = require( '@stdlib/utils-keys' );
var tools = require( '@stdlib/error-tools' );

console.log( objectKeys( tools ) );

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.