Check Node.js ECMAScript compatibility.
Using Yarn:
yarn add node-green
Using npm:
npm install node-green
const nodeGreen = require('node-green')
;(async () => {
// Use the version of Node.js you're running by default
let result = await nodeGreen('Array.prototype.includes')
console.log(result)
let result = await nodeGreen('Array.prototype.includes', { nodeVersion: '6.4.0' })
console.log(result)
// Allow `harmony` flag
let result = await nodeGreen('Array.prototype.includes', { allowHarmony: true })
console.log(result)
})
Fetch williamkapke/node-compat-table and returns query result.
Type: string
ES feature you want to search.
Type: object
Type: boolean
Allow using --harmony
flag for Node.js.
Type: string
Specify Node.js version. If it is omitted, use the version of Node.js you are running currently.
Type: object
Type: string
Node.js verison.
Type: string
V8 version.
Type: Array
An array of query result.
Type: string
It will be one of ESNEXT
, ES2018
, ES2017
, ES2016
, ES2015
.
Type: string
It may be one of misc
, syntax
, functions
and so on.
Type: string
Type: string
Type: boolean
Indicates whether the feature was passed under that Node.js.
node-green-cli - CLI for this module.
Thanks @williamkapke's work: williamkapke/node-compat-table.
MIT License
Copyright (c) 2018-present Pig Fang