0.5.3 • Published 1 year ago

node-green v0.5.3

Weekly downloads
7
License
MIT
Repository
github
Last release
1 year ago

node-green

Check Node.js ECMAScript compatibility.

License NPM Version

Installation

Using Yarn:

yarn add node-green

Using npm:

npm install node-green

Usage

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)
})

API

nodeGreen(feature, options)

Fetch williamkapke/node-compat-table and returns query result.

feature

Type: string

ES feature you want to search.

options

Type: object

allowHarmony

Type: boolean

Allow using --harmony flag for Node.js.

nodeVersion

Type: string

Specify Node.js version. If it is omitted, use the version of Node.js you are running currently.

Return Type

Type: object

nodeVersion

Type: string

Node.js verison.

v8Version

Type: string

V8 version.

result

Type: Array

An array of query result.

esVersion

Type: string

It will be one of ESNEXT, ES2018, ES2017, ES2016, ES2015.

featureType

Type: string

It may be one of misc, syntax, functions and so on.

category

Type: string

feature

Type: string

passed

Type: boolean

Indicates whether the feature was passed under that Node.js.

Related Projects

node-green-cli - CLI for this module.

Credits

Thanks @williamkapke's work: williamkapke/node-compat-table.

License

MIT License

Copyright (c) 2018-present Pig Fang

0.5.3

1 year ago

0.5.0

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago