es-constants
v1.0.1
Published
An ES-spec-compliant shim/polyfill/replacement for JS language Math and Number constant values that works as far down as ES3
Downloads
3,055
Maintainers
Readme
es-constants
An ES-spec-compliant shim/polyfill/replacement for JS language Math and Number constant values that works as far down as ES3.
This package implements the es-shim API “multi” interface. It works in an ES3-supported environment and complies with the spec.
The main export of the package itself is simply an array of the available directory names. It’s sole intended use is for build tooling and testing.
Supported methods
Math.E
Math.LN10
Math.LN2
Math.LOG10E
Math.LOG2E
Math.PI
Math.SQRT1_2
Math.SQRT2
Number.EPSILON
Number.MAX_SAFE_INTEGER
Number.MAX_VALUE
Number.MIN_SAFE_INTEGER
Number.MIN_VALUE
Number.NEGATIVE_INFINITY
Number.POSITIVE_INFINITY
Getting started
npm install --save es-constants
Usage/Examples
var assert = require('assert');
require('./auto'); // shim all of the constants
require('./Number.MAX_VALUE/auto'); // shim the Number.MAX_VALUE constant
Tests
Simply clone the repo, npm install
, and run npm test