detect-es

0.10.2 • Public • Published

detect-es

Detect ESnext features in your code.

NPM version NPM downloads CircleCI donate chat

preview

Use cases

Prevent from shipping unexpected ES6 code to your users, and more...

What's supported?

Features

  • [x] const
  • [x] let
  • [x] template literal
  • [x] tagged template literal
  • [x] class
  • [x] arrow function
  • [x] async/await
  • [x] es module
  • [x] dynamic import
  • [x] destructuring
  • [x] generator
  • [x] for..of
  • [ ] PR to add more...

APIs

  • [x] Object.assign
  • [x] Map Set WeakMap WeakSet
  • [x] Promise
  • [x] Proxy
  • [ ] PR to add more...

Install

yarn global add detect-es

CLI

detect-es foo.js

API

const { parse }  = require('detect-es')

const stats = parse('const foo = {...bar}')
console.log(stats.has('const'))
// true
console.log(stats.has('object_rest_spread'))
// true

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

detect-es © EGOIST, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).

egoist.moe · GitHub @EGOIST · Twitter @_egoistlily

Readme

Keywords

none

Package Sidebar

Install

npm i detect-es

Weekly Downloads

1

Version

0.10.2

License

MIT

Last publish

Collaborators

  • rem