Code Monkey home page Code Monkey logo

node-green's Introduction

node-green

Check Node.js ECMAScript compatibility.

Travis Codecov License NPM Version NPM Downloads

Installation

Using Yarn:

$ yarn add node-green

Using npm:

$ npm install node-green

Usage

const nodeGreen = require('node-green')
void (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<{ esVersion: string, category: string, feature: string, passed: boolean }>

An array of query result.

esVersion

Type: string

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

category

Type: string

feature

Type: string

passed

Type: boolean

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

Credits

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

License

Apache License 2.0

Copyright (c) 2018-present Pig Fang

node-green's People

Contributors

g-plane avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.