Detect ESnext features in your code.
Prevent from shipping unexpected ES6 code to your users, and more...
- [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...
- [x]
Object.assign
- [x]
Map
Set
WeakMap
WeakSet
- [x]
Promise
- [x]
Proxy
- [ ] PR to add more...
yarn global add detect-es
detect-es foo.js
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
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
detect-es © EGOIST, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).
egoist.moe · GitHub @EGOIST · Twitter @_egoistlily