0.4.1 • Published 4 years ago

node-red-contrib-sax1johno-function-npm v0.4.1

Weekly downloads
15
License
Apache-2.0
Repository
github
Last release
4 years ago

node-red-contrib-function-npm

Node red function node with capability to install and use packages from npm

Install

From your node-red directory

Usage

The function-npm node behaves like a normal function node, with the exception of allowing the use of npm modules within the script inside the block. It scans the script for any require statements and downloads the modules specified in the require statements. The module is automatically cleaned from the disk when the node-red process closes.

//syntax to install a specific version
var lowerCase = require('lower-case@1.1.3')

//if no version specified the latest version is installed
var upperCase = require('upper-case');

msg.payload = {             
    upper: upperCase('Hello World'),
    lower: lowerCase('Hello World')
} ;
return msg;

Project Info

URLs

NameLink
Github Repohttps://github.com/ntsaini/node-red-contrib-function-npm
NPM Packagehttps://www.npmjs.com/package/node-red-contrib-function-npm

Contributions

If you'd like to contribute to this project, feel invited to commit to this repository!

License

This work is licensed under the Apache License, Version 2.0.

Credits