JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 95
  • Score
    100M100P100Q101495F
  • License Apache-2.0

Return the package name associated with a specified error identifier prefix.

Package Exports

  • @stdlib/error-tools-id2pkg
  • @stdlib/error-tools-id2pkg/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@stdlib/error-tools-id2pkg) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

id2pkg

NPM version Build Status Coverage Status

Return the package name associated with a specified error identifier prefix.

Installation

npm install @stdlib/error-tools-id2pkg

Usage

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

id2pkg( id )

Returns the package name associated with a specified error identifier prefix.

var v = id2pkg( '0H5' );
/- returns '@stdlib-math-base-special-sin'

If provided an unrecognized error identifier prefix, the function returns null.

var v = id2pkg( 'unrecognized_alias_beep_boop_bop_bip' );
// returns null

Examples

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

var list;
var len;
var v;
var i;

list = [
    '001',
    '0A3',
    '0Ab'
];
len = list.length;

for ( i = 0; i < len; i++ ) {
    v = list[ i ];
    console.log( 'id: %s. pkg: %s.', v, id2pkg( v ) );
}

CLI

Installation

To use the module as a general utility, install the module globally

npm install -g @stdlib/error-tools-id2pkg

Usage

Usage: stdlib-id2pkg [options] <id>

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.

Examples

$ stdlib-id2pkg '0H5'
@stdlib/math/base/special/sin

License

The data files (databases) are licensed under an Open Data Commons Public Domain Dedication & License 1.0 and their contents are licensed under Creative Commons Zero v1.0 Universal. The software is licensed under Apache License, Version 2.0.


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


Copyright © 2016-2022. The Stdlib Authors.