Registry / web-framework / node-red-contrib-moment

node-red-contrib-moment

JSON →
library5.0.0jsnpmunverified

Node-RED node for date/time formatting using Moment.js, with timezone, DST, and locale support. Current stable version is 5.0.0, requiring Node.js >=14.14 and Node-RED >=1.0. Provides two nodes: 'moment' for date/time formatting and 'humanizer' for duration descriptions. Locale-aware output strings. Note that moment.js is now built into JSONata, making this package less necessary; no further enhancements expected. Release cadence is irregular, with major versions introducing breaking dependency updates.

npm install node-red-contrib-moment
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-M
N
node-red-contrib-moment
web-frameworkjavascriptv5.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

node-red-contrib-moment
Package is installed as a Node-RED node; no explicit import in code.
Attempting to import or require the package directly (e.g., const momentNode = require('node-red-contrib-moment')) is incorrect.
The package registers nodes with Node-RED at installation time. No manual import is needed.

Installation and basic usage of the moment node in Node-RED: inject timestamp, configure format, output.

// No code import; install via Node-RED palette or run: // cd ~/.node-red && npm install node-red-contrib-moment // Then use the 'moment' node in your flows: // 1. Inject a timestamp (or msg with a payload convertible to date) // 2. Connect to moment node // 3. Configure output format (e.g., "MMMM Do YYYY, h:mm:ss a") // 4. Connect to debug node to see formatted string
Debug
Known issues
breakingNode.js minimum version raised to v10 and Node-RED minimum to v1.0 in v4.0.0.
fix
Upgrade Node.js to >=10 and Node-RED to >=1.0 before installing v4+.
affects: >=4.0.0
deprecatedPackage is unlikely to receive further enhancements; moment.js is built into JSONata.
fix
Consider using Node-RED's built-in JSONata moment functions in Change or Function nodes instead.
affects: >=5.0.0
gotchaMoment.js treats months as zero-based (0 = January) when parsing object formats.
fix
Always verify month values: January is 0, December is 11.
affects: *
gotchaIf msg.payload is not a valid date string or timestamp, the node may output 'Invalid date'.
fix
Ensure input is a ISO 8601 string, Unix timestamp (milliseconds), or Date object.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'node-red-contrib-moment'
Package not installed or installed in wrong directory.
fix
Run 'npm install node-red-contrib-moment' from your Node-RED userDir (typically ~/.node-red).
TypeError: moment is not a function
Attempting to use moment() directly from the package, which exports Node-RED nodes not a moment function.
fix
Do not require the package; use the node in your flows.
Error: Module version mismatch. Expected 83, got 84.
Node.js version mismatch with native addon (though this package has none, but arises with native deps).
fix
Ensure Node.js version matches the one used during npm install. Try reinstalling: rm -rf node_modules && npm install.
Upgrade
Version history
5.0.0latest on npm
Audit
Dependencies
momentrequiredCore date/time manipulation library used by the nodes
Agent activity
2 hits · last 30 days
node
2
Resources
node-red-contrib-moment — npm install node-red-contrib-moment · libregistry