Giter Site home page Giter Site logo

feature-detect-es6's Introduction

view on npm npm module downloads Build Status Dependency Status js-standard-style

feature-detect-es6

Detect which ES2015 features are available.

Example

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

if (detect.all('class', 'spread', 'let', 'arrowFunction')){
  // safe to run ES6 code natively..
} else {
  // run your transpiled ES5..
}

detect.class() ⇒ boolean

Returns true if the class statement is available.

Kind: static method of feature-detect-es6

detect.arrowFunction() ⇒ boolean

Returns true if the arrow functions available.

Kind: static method of feature-detect-es6

detect.let() ⇒ boolean

Returns true if the let statement is available.

Kind: static method of feature-detect-es6

detect.const() ⇒ boolean

Returns true if the const statement is available.

Kind: static method of feature-detect-es6

detect.newArrayFeatures() ⇒ boolean

Returns true if the new Array features are available (exluding Array.prototype.values which has zero support anywhere).

Kind: static method of feature-detect-es6

detect.collections() ⇒ boolean

Returns true if Map, WeakMap, Set and WeakSet are available.

Kind: static method of feature-detect-es6

detect.generators() ⇒ boolean

Returns true if generators are available.

Kind: static method of feature-detect-es6

detect.promises() ⇒ boolean

Returns true if Promise is available.

Kind: static method of feature-detect-es6

detect.templateStrings() ⇒ boolean

Returns true if template strings are available.

Kind: static method of feature-detect-es6

detect.symbols() ⇒ boolean

Returns true if Symbol is available.

Kind: static method of feature-detect-es6

detect.destructuring() ⇒ boolean

Returns true if destructuring is available.

Kind: static method of feature-detect-es6

detect.spread() ⇒ boolean

Returns true if the spread operator (...) is available.

Kind: static method of feature-detect-es6

detect.defaultParamValues() ⇒ boolean

Returns true if default parameter values are available.

Kind: static method of feature-detect-es6

detect.all() ⇒ boolean

Returns true if all specified features are detected.

Kind: static method of feature-detect-es6

Param Type Description
[...feature] string the features to detect.

Example

var result = detect.all('class', 'spread', 'let', 'arrowFunction')

© 2015-16 Lloyd Brookes <[email protected]>. Documented by jsdoc-to-markdown.

feature-detect-es6's People

Contributors

75lb avatar

Watchers

James Cloos avatar Kyle Constance avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.