node-feature-detect

1.0.0 • Public • Published

node-feature-detect

Checks for features.

var detect = require('node-feature-detect')

detect.features
// [ 'generators', 'let', 'fat arrow', ... ]

detect('class', 'generators')
// { unsupported: 'class', minVersion: '4.0.0' }

or:

var unsupported = detect('let')
if (unsupported) {
  // ...
}

Or you can automatically fail:

detect.fail('class', 'generators')

// Error: Your platform doesn't support these features: generators, class.
// Please upgrade to Node.js v4.0.0 or above.

Features:

  • class
  • fat arrow
  • generators
  • let
  • object.assign
  • promise
  • symbol
  • template string
  • weakmap

Thanks

node-feature-detect © 2015+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz

Package Sidebar

Install

npm i node-feature-detect

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • rstacruz