js-features-used

0.0.2 • Public • Published

js-features-used

styled with prettier

Detect the JavaScript language features used in code

var featuresUsed = require('features-used')

console.log(featuresUsed(`
const foo = 'bar'
let baz = { foo }

async function main() {
    const r = /hello/u
    baz.foo.match(r)
}

main()
`))

/*
 [ { name: 'const bindings', requiredVersion: '4.8.3' },
   { name: 'let bindings', requiredVersion: '4.8.3' },
   { name: 'literal shorthand', requiredVersion: '4.8.3' },
   { name: 'async functions', requiredVersion: '7.10.0' },
   { name: 'regex y and u flags', requiredVersion: '6.4.0' } ]
*/

/js-features-used/

    Package Sidebar

    Install

    npm i js-features-used

    Weekly Downloads

    6

    Version

    0.0.2

    License

    MIT

    Last publish

    Collaborators

    • wtfaremyinitials