UNPKG

idi-custom-nodered

Version:

Custom Node-RED nodes and utilities - IDI Timestamp node for adding timestamps to messages

34 lines (22 loc) 619 B
# IDI Custom Node-RED Custom Node-RED nodes and utilities for IDI projects. ## Installation ```bash npm install idi-custom-nodered ``` ## Usage ```javascript const idiNodes = require('idi-custom-nodered'); // Use utility functions const timestamp = idiNodes.utils.formatTimestamp(); console.log(timestamp); // Register with Node-RED (if using in Node-RED environment) idiNodes.registerNodes(RED); ``` ## API ### Utils - `formatTimestamp(date)` - Format a date as ISO string - `validateConfig(config)` - Validate node configuration object - `deepMerge(target, source)` - Deep merge two objects ## License MIT