Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/hugojosefson/minimum-node-version

Figures out the lowest version of Node.js that satisfies engines.node in package.json.
https://github.com/hugojosefson/minimum-node-version

babel-preset-env nodejs semver version

Last synced: 29 days ago
JSON representation

Figures out the lowest version of Node.js that satisfies engines.node in package.json.

Awesome Lists containing this project

README

        

# minimum-node-version

[![Build Status](https://travis-ci.org/hugojosefson/minimum-node-version.svg?branch=master)](https://travis-ci.org/hugojosefson/minimum-node-version)
[![npm page](https://img.shields.io/npm/v/minimum-node-version.svg)](https://npmjs.com/package/minimum-node-version)
[![License ISC](https://img.shields.io/npm/l/minimum-node-version.svg)](https://tldrlegal.com/license/-isc-license)
[![SemVer 2.0.0](https://img.shields.io/badge/SemVer-2.0.0-lightgrey.svg)](http://semver.org/spec/v2.0.0.html)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Introduction

Figures out the lowest version of Node.js that satisfies `engines.node` in `package.json`.

Can be quite useful for which `node` version to configure `babel-preset-env` for.

## Prerequisite

Node.js, at least `v8.0.0`, but not `v9`.

Recommended to install latest via [nvm](https://github.com/nvm-sh/nvm#readme):

```bash
nvm install stable
```

## Installation

```bash
npm install -g minimum-node-version
```

## CLI Usage

```bash
minimum-node-version
```

Will print the Node.js version.

## Programmatic access

You can also `import` or `require` the module, and use it programmatically.

```js
import minimumNodeVersion from 'minimum-node-version'

minimumNodeVersion().then(
version => console.log(version)
)
```

### API

##### Table of Contents

- [minimumNodeVersion](#minimumnodeversion)

#### minimumNodeVersion

Figures out the minimum Node.js version that satisfies the project's configuration.

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** A Promise of the lowest compatible Node.js version.