https://github.com/alt-javascript/lang
Feature detection utilities for ECMAScript 6 and beyond
https://github.com/alt-javascript/lang
Last synced: 10 months ago
JSON representation
Feature detection utilities for ECMAScript 6 and beyond
- Host: GitHub
- URL: https://github.com/alt-javascript/lang
- Owner: alt-javascript
- License: mit
- Created: 2022-03-18T01:50:49.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-18T08:24:26.000Z (almost 4 years ago)
- Last Synced: 2025-02-17T03:47:21.716Z (11 months ago)
- Language: JavaScript
- Homepage:
- Size: 188 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
README
Language feature detection utilities for ECMAScript 6 and beyond.
===================================
[](https://nodei.co/npm/@alt-javascript/lang/)


[release notes](https://github.com/alt-javascript/lang/blob/main/History.md)
Introduction
--------------------------------
Language feature detection utilities for ECMAScript 6 and beyond, currently bundling the [es-feature-detection](https://www.npmjs.com/package/es-feature-detection) and
[feature-detect-es6](https://www.npmjs.com/package/feature-detect-es6) npm packages.
Usage
-------------------------
The module can be used directly in the browser, as an IIFE (Immediately Invoked Function Expression),
using the global variable `lang` as follows:
```html
if (!lang.allOk(lang.es2020)){
console.error('We\'re sorry but the site requires JavaScript 11 (ECMAScript 2020). Please upgrade your browser to continue.')
document.getElementById("require_es2020").style.display = "block"
}
```
License
-----------------------------
May be freely distributed under the [MIT license](https://raw.githubusercontent.com/alt-javascript/lang/main/LICENSE).
Copyright (c) 2021-2022 Craig Parravicini