js-syntax-detector
v1.0.11
Published
A JavaScript newer syntax(ES6+) detector, Only focused on **lexical** syntax, not APIs. Because new lexical syntax will cause SyntaxError, it breaks your code, and cannot caught. while the APIs may not, it can be polyfilled or caught.
Readme
JavaScript syntax detector
A JavaScript newer syntax(ES6+) detector, Only focused on lexical syntax, not APIs. Because new lexical syntax will cause SyntaxError, it breaks your code, and cannot caught. while the APIs may not, it can be polyfilled or caught.
check it online js-syntax.
YES:
- new token(=?)
- new keywords(yield, await)
- new operators(**)
- new literals(template literals)
- ...
NO:
- Promise
- globalThis
- Array.prototype.API
- Map/Set/WeakMap/WeakSet
- ...
screenshots
CLI tool
Darwin
curl -o js-syntax https://unpkg.com/[email protected]/bin/darwin/js-syntax
chmod +x js-syntax
./js-syntax --helpLinux(x86_64)
curl -o js-syntax https://unpkg.com/[email protected]/bin/linux/js-syntax
chmod +x js-syntax
./js-syntax --helpUse it in your project
npm install -g js-syntax-detector