1.0.0 • Published 9 years ago

node-feature-detect v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

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