An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

Language feature detection utilities for ECMAScript 6 and beyond.
===================================

[![NPM](https://nodei.co/npm/@alt-javascript/lang.svg?downloads=true&downloadRank=true)](https://nodei.co/npm/@alt-javascript/lang/)


![Language Badge](https://img.shields.io/github/languages/top/alt-javascript/lang)
![Package Badge](https://img.shields.io/npm/v/@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