# node-engineer

> Parse package.json, inspect engines property and ensure command runs with right node.js version

Latest version **0.2.8** (published 2012-06-29) · 0 weekly downloads

## Install

```sh
npm install node-engineer
pnpm add node-engineer
yarn add node-engineer
bun add node-engineer
```

Provides the command `engineer`.

## Health

**Score 0/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.8 |
| Published | 2012-06-29 |
| First published | 2012-06-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.6.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Niall O'Higgins |
| Maintainers | niallo |

## Links

- npm: https://www.npmjs.com/package/node-engineer
- npm.io page: https://npm.io/package/node-engineer

## Dependencies (3)

- [nave](https://npm.io/package/nave.md) git://github.com/niallo/nave.git#5fdb24773195edfc0e6020a730d506b2046dc922
- [semver](https://npm.io/package/semver.md) >=1.0.14
- [optimist](https://npm.io/package/optimist.md) >=0.3.4

## Recent versions

- 0.2.8 (latest) — 2012-06-29
- 0.2.7 — 2012-06-27
- 0.2.6 — 2012-06-25
- 0.2.5 — 2012-06-25
- 0.2.4 — 2012-06-25
- 0.2.3 — 2012-06-25
- 0.2.2 — 2012-06-25
- 0.2.1 — 2012-06-24
- 0.2.0 — 2012-06-24
- 0.1.0 — 2012-06-24

## README

node-engineer
=============

Parse package.json, inspect `engines` property and ensure command runs with right node.js version - avoiding as much compilation as possible.

Engineer makes it trivial to run a command in an environment where `node` and
`npm` match those specified by a particular package.json's `engines` field. It
attempts to do this using already-present node binaries to save time if at all
possible. Otherwise, it will reach out to the Internet, download, compile and
install a satisfying version of Node.Js.

Engineer will try in this order, using the first satisfying version it finds:

* Inspect the version of node.js in the `$PATH` to see if it satifies `engines`.
* Inspect the version of node.js versions already installed locally via `nave` to
  see if any of those satifies `engines`.
* Pick the maximum remote version of node.js which satisfies via `nave`.

This makes it a no-brainer to run an arbitrary package under whatever version
of node it needs. Engineer uses `nave` and `semver` to do the heavy lifting of
installing and checking for valid node.js versions.

Installation
============
```
npm install -g node-engineer
```

Usage
=====
```
execute command with node version acceptable to engines package.json property
usage: engineer

Options:
  -c  Shell command         [required]
  -f  Path to package.json  [required]

Missing required arguments: c, f
```

Demo
====

```
# "node":">=0.6.19 <0.7.0"
# $PATH contains node 0.6.17
# No existing locally-installed nave versions

$ engineer -f package.json -c 'npm ls'
System non-Nave Node.JS version 0.6.17 does not satisfy range >=0.6.19 <0.7.0
local versions: []
Remote version 0.6.19 satisfies range >=0.6.19 <0.7.0
running cmd: ["./node_modules/nave/nave.sh","use","0.6.19","npm","ls"]
```

```
# "node":">=0.6.0 <0.7.0"
# $PATH contains node 0.6.17

$ engineer -f package.json -c 'npm ls'
System non-Nave Node.JS version 0.6.17 satisfies range >=0.6.0 <0.7.0
running cmd: ["npm","ls"]
node-engineer@0.2.0 /Users/nialljohiggins/projects/node-engineer
├── chai@1.0.4  extraneous
├─┬ mocha@1.2.0  extraneous
│ ├── commander@0.5.2 
│ ├── debug@0.7.0 
│ ├── diff@1.0.2 
│ ├── growl@1.5.1 
│ └─┬ jade@0.20.3 
│   └── mkdirp@0.3.3 
├── nave@0.2.13 
├─┬ optimist@0.3.4 
│ └── wordwrap@0.0.2 
└── semver@1.0.14 
```

Credits
=======

This is a glue package which relies on:

* [Nave by IsaacS](https://github.com/isaacs/nave)
* [semver by IsaacS](https://github.com/isaacs/node-semver)
* [optimist by substack](https://github.com/substack/node-optimist)

---
_Source: https://npm.io/package/node-engineer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
