@yousolution/node-red-contrib-you-npm-version-checker 1.0.0
Node-RED node to check npm package versions against the registry
node-red-contrib-you-npm-version-checker
A Node-RED node to check and update npm package versions against the official npm registry.
Install
npm
cd ~/.node-red
npm install node-red-contrib-you-npm-version-checker
Then restart Node-RED.
GitHub
cd ~/.node-red/nodes
git clone https://github.com/yourusername/node-red-contrib-you-npm-version-checker.git
cd node-red-contrib-you-npm-version-checker
npm install
Restart Node-RED.
Features
- Check npm packages for outdated versions
- Compare installed vs latest versions using semver
- Periodic automatic checking (configurable interval)
- Install package updates directly from Node-RED
- Visual status indicators in the editor
- Supports scoped packages (
@scope/package)
Usage
Node Configuration
| Property | Description |
|---|---|
| Name | Display name for the node |
| Packages | Comma-separated list of npm packages to monitor |
| Check Interval | Minutes between automatic checks (default: 60) |
| Check on Start | Run check when node starts (default: true) |
| Auto-update | Automatically update outdated packages (default: false) |
Input
Send any message to trigger a version check. You can also:
| Message Property | Description |
|---|---|
msg.packages |
Array to override configured packages |
msg.update |
Set to true to update a package |
msg.package |
Package name to update (required when msg.update is true) |
Example - Trigger update:
{
"update": true,
"package": "lodash"
}
Outputs
The node has 3 outputs:
- All results - Complete array of package check results
- Summary - Summary with totals (total, outdated, upToDate, errors)
- Outdated only - Array of only outdated packages
Status Indicators
| Status | Color | Description |
|---|---|---|
| Ready | Grey | Initialized |
| Checking... | Blue | Checking packages |
| X outdated | Red | Packages need updating |
| Up to date | Green | All packages current |
| Updated: name | Green | Package updated successfully |
Example Payload (Output 1)
{
"payload": [
{
"package": "lodash",
"installed": "4.17.20",
"latest": "4.17.21",
"outdated": true,
"diff": "patch"
}
],
"summary": {
"total": 1,
"outdated": 1,
"upToDate": 0,
"errors": 0
},
"timestamp": 1699999999999
}
Version Diff Values
major- Breaking change (e.g., 4.x.x → 5.0.0)minor- New feature (e.g., 4.17.x → 4.18.0)patch- Bug fix (e.g., 4.17.20 → 4.17.21)not-installed- Package not found in node_modulesunknown- Unable to determine difference
Example Flow
[{"id":"1","type":"inject","z":"flow","name":"Check now","topic":"","payload":"","payloadType":"date","x":120,"y":100,"wires":[["2"]]},
{"id":"2","type":"npm-version-checker","z":"flow","name":"Check packages","packages":"lodash,express","interval":"60","checkOnStart":true,"x":300,"y":100,"wires":[["3"],["4"],["5"]]},
{"id":"3","type":"debug","z":"flow","name":"All results","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":550,"y":60,"wires":[]},
{"id":"4","type":"debug","z":"flow","name":"Summary","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":550,"y":100,"wires":[]},
{"id":"5","type":"debug","z":"flow","name":"Outdated","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":550,"y":140,"wires":[]}]
Requirements
- Node.js >=14.0.0
- Node-RED >=3.0.0
- Internet connection (to query npm registry)
Troubleshooting
"Package not found" errors
- Verify the package name at npmjs.com
- Use full name for scoped packages (e.g.,
@babel/core)
Node not appearing in palette
- Restart Node-RED after installation
- Check Node-RED logs for errors
Timeout errors
- Check internet connection
- npm registry may be slow (try again later)
Development
# Run tests
npm test
# Build package
npm run build
License
MIT - See LICENSE file.