Detalhes do pacote

enable

node-modules144.1kMIT3.4.0

ES6 and ES7 feature detection.

enable, es6, es7, detect

readme (leia-me)

enable

NPM version build status Test coverage Gittip David deps node version npm download

Detect es6 and es7 features enable or not.

Install

$ npm install enable --save

Usage

var enable = require('enable');

if (enable.<feature>) {
  console.log(<feature> is supported);
}

/* Example:
if (enable.generator) {
  console.log('supports generator: `function* a() {}`');
}
*/

List of features:

Object related:

  • Object.is
  • Object.assign
  • Object.getOwnPropertySymbols
  • Object.setPrototypeOf
  • Object.observe
  • Object.Object.getOwnPropertyDescriptors

String related:

  • String.raw
  • String.fromCodePoint
  • String.prototype.codePointAt
  • String.prototype.normalize
  • String.prototype.repeat
  • String.prototype.startsWith
  • String.prototype.endsWith
  • String.prototype.contains
  • String.prototype.anchor
  • String.prototype.big
  • String.prototype.bold
  • String.prototype.fixed
  • String.prototype.fontcolor
  • String.prototype.fontsize
  • String.prototype.italics
  • String.prototype.link
  • String.prototype.small
  • String.prototype.strike
  • String.prototype.sub
  • String.prototype.sup

Number related:

  • Number.isFinite
  • Number.isInteger
  • Number.isSafeInteger
  • Number.isNaN
  • Number.EPSILON
  • Number.MIN_SAFE_INTEGER

Math related:

  • Math.clz32
  • Math.imul
  • Math.sign
  • Math.log10
  • Math.log2
  • Math.log1p
  • Math.expm1
  • Math.cosh
  • Math.sinh
  • Math.tanh
  • Math.acosh
  • Math.asinh
  • Math.atanh
  • Math.hypot
  • Math.trunc
  • Math.fround
  • Math.cbrt

RefExp methods:

  • RegExp.prototype.match
  • RegExp.prototype.replace
  • RegExp.prototype.split
  • RegExp.prototype.search

Map related:

  • Map
  • Map.prototype.size
  • Map.prototype.get
  • Map.prototype.has
  • Map.prototype.set
  • Map.prototype.delete
  • Map.prototype.keys
  • Map.prototype.values
  • Map.prototype.clear
  • Map.prototype.forEach
  • Map.prototype.entries

WeakMap related:

  • WeakMap
  • WeakMap.length
  • WeakMap.prototype.constructor
  • WeakMap.prototype.get
  • WeakMap.prototype.set
  • WeakMap.prototype.has
  • WeakMap.prototype.delete
  • WeakMap.prototype.clear

Set related:

  • Set
  • Set.prototype.constructor
  • Set.prototype.size
  • Set.prototype.add
  • Set.prototype.has
  • Set.prototype.delete
  • Set.prototype.clear
  • Set.prototype.forEach
  • Set.prototype.entries
  • Set.prototype.keys
  • Set.prototype.values

WeakSet related:

  • WeakSet
  • WeakSet.prototype.constructor
  • WeakSet.prototype.add
  • WeakSet.prototype.has
  • WeakSet.prototype.delete
  • WeakSet.prototype.clear

Array related:

  • Array.from
  • Array.of
  • Array.prototype.copyWithin
  • Array.prototype.find
  • Array.prototype.findIndex
  • Array.prototype.fill
  • Array.prototype.keys
  • Array.prototype.values
  • Array.prototype.entries

Others:

  • generator.
  • arrowFunction
  • asyncFunction
  • asyncArrowFunction
  • let.
  • const.
  • Promise.
  • class.

Test

$ npm install
$ npm test

Coverage

$ npm test-cov

changelog (log de mudanças)

3.4.0 / 2020-02-15

features

others

3.2.0 / 2014-12-13

  • All WeakSet related checks.
  • All Set related checks.

3.1.0/ 2014-12-09

  • All WeakMap related checks.

3.0.0 / 2014-12-09

  • All Map realted checks.

2.3.1 / 2014-12-08

  • Better isFunction check.
  • s/realted/related README.md

2.3.0 / 2014-12-02

  • ES7 Object methods.

2.2.0 / 2014-11-19

  • Function.prototype.toMethod
  • RegExp.prototype.match
  • RegExp.prototype.replace
  • RegExp.prototype.split
  • RegExp.prototype.search

2.1.0 / 2014-11-17

  • HTML methods of String.prototype (@hemanth).

2.0.0 / 2014-11-16

  • Regex realted methods.
  • Major revamp (@hemanth)

1.3.2 / 2014-11-11

  • Math realted methods.
  • Better readme.

1.3.1 / 2014-11-10

  • Number method checks.

1.3.0 / 2014-11-10

  • feat: Supports String checks. (@hemanth)

1.2.0 / 2014-10-31

  • feat: Supports Object.{is,assign,getOwnPropertySymbols,setPrototypeOf}

1.1.0 / 2014-10-30

  • Should detect const (@hemanth)

1.0.2 / 2014-10-30

  • refactor, use eval
  • chore(travis): add before_install script

1.0.1 / 2014-10-30

  • add let support (@alsotang)

1.0.0 / 2014-10-30

  • first commit