# node-red-contrib-functionx

> Clone of the Node-RED function node with capability to automatically install used NPM packages

Latest version **1.0.3** (published 2020-12-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install node-red-contrib-functionx
pnpm add node-red-contrib-functionx
yarn add node-red-contrib-functionx
bun add node-red-contrib-functionx
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-12-02 |
| First published | 2020-03-01 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 50.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dr. Ralf S. Engelschall |
| Maintainers | rse |
| Keywords | node-red, function, npm, require |

## Links

- npm: https://www.npmjs.com/package/node-red-contrib-functionx
- Repository: https://github.com/rse/node-red-contrib-functionx
- Homepage: https://github.com/rse/node-red-contrib-functionx#readme
- Issues: https://github.com/rse/node-red-contrib-functionx/issues
- npm.io page: https://npm.io/package/node-red-contrib-functionx

## Dependencies (5)

- [npm](https://npm.io/package/npm.md) 6.14.9
- [temp](https://npm.io/package/temp.md) 0.9.4
- [events](https://npm.io/package/events.md) 3.2.0
- [npm-install-to](https://npm.io/package/npm-install-to.md) 3.0.1
- [strip-comments](https://npm.io/package/strip-comments.md) 2.0.1

## Recent versions

- 1.0.3 (latest) — 2020-12-02
- 1.0.2 — 2020-10-21
- 1.0.1 — 2020-07-13
- 1.0.0 — 2020-07-06
- 0.9.7 — 2020-07-06
- 0.9.6 — 2020-03-02
- 0.9.5 — 2020-03-01
- 0.9.4 — 2020-03-01
- 0.9.3 — 2020-03-01
- 0.9.2 — 2020-03-01
- 0.9.1 — 2020-03-01
- 0.9.0 — 2020-03-01

## README

# node-red-contrib-functionx

Clone of Node-RED function node with capability to automatically install used NPM packages.

## Install

```sh
$ npm install node-red-contrib-functionx
```

## Usage

The Node-RED **functionx** node behaves exactly like the standard
Node-RED **function** node, with the exception of allowing the use of
NPM modules within the JavaScript code. For this, the node scans the
JavaScript code for any `require()` statements and automatically and
temporarily installs the NPM modules referenced in the `require()`
statements. The temporarily installed NPM modules are automatically
cleaned from the disk when the Node-RED process closes.

## Example

```js
var { upperCase } = require("upper-case")       // install latest   version
var lowerCase     = require("lower-case@1.1.3") // install specific version
msg.payload = {             
    upper: upperCase("Hello World"),
    lower: lowerCase("Hello World")
}
return msg
```

## License

This Node-RED node is licensed under the [Apache License 2.0](https://spdx.org/licenses/Apache-2.0.html).

## Credits

This Node-RED node is a derived from the latest
version (as of 2020-12-02) of the official
[Node-RED 1.2.6 **function** node](https://github.com/node-red/node-red/blob/master/packages/node_modules/%40node-red/nodes/core/function/10-function.js)
and was patched with the extra functionality from John O'Connor's
[fork of the node-red-contrib-function-npm](https://github.com/sax1johno/node-red-contrib-function-npm)
Node-RED node.

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