https://github.com/axetroy/ecma-detector
A tool for detecting the ECMAScript version of javascript code
https://github.com/axetroy/ecma-detector
detector ecmascript
Last synced: about 1 month ago
JSON representation
A tool for detecting the ECMAScript version of javascript code
- Host: GitHub
- URL: https://github.com/axetroy/ecma-detector
- Owner: axetroy
- License: other
- Created: 2024-08-12T01:20:17.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-04-23T05:58:56.000Z (about 2 months ago)
- Last Synced: 2025-04-23T06:01:48.197Z (about 2 months ago)
- Topics: detector, ecmascript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/ecma-detector
- Size: 94.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# ecma-detector
[](https://996.icu/#/en_US)
[](https://github.com/996icu/996.ICU/blob/master/LICENSE)

[](https://badge.fury.io/js/ecma-detector)A tool to detect ECMAScript version.
## Installation
```bash
npm install ecma-detector --save
```## Usage
```js
// import via esm
import { isECMAScript } from "ecma-detector";// import via cjs
const { isECMAScript } = require("ecma-detector");
``````js
import { isECMAScript, isECMAScript2020 } from "ecma-detector";isECMAScript("let foo = bar", "2015"); // true
isECMAScript2020("let foo = a ?? b"); // true
```## License
The [Anti 996 License](LICENSE)