npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-wip

v0.0.2

Published

A Node-RED module to track and manage work in progress by monitoring the duration of a process through start and stop times.

Downloads

29

Readme

node-red-contrib-wip

A Node-RED module designed to track and manage work in progress by monitoring the duration of a process through start and stop times. This module provides two custom nodes, workInProgress and workInProgressDisplay, with advanced features for precise time management and monitoring.

Features

  • Tracks the process duration by monitoring start and stop times with millisecond precision
  • Provides a reset option to clear the data and prepare for the next process cycle
  • Outputs data in JSON format, including start time, stop time, and duration
  • Converts start and stop times into the format dd-mm-yyyy and hh:mm:ss for better readability
  • Displays the output in a user-friendly message format
  • Ideal for monitoring production lines, manufacturing processes, or any task that requires precise time management and tracking

Installation

Use the following command to install the module:

npm install node-red-contrib-wip

Usage

  1. Import the workInProgress and workInProgressDisplay nodes in your Node-RED flow.
  2. Connect the workInProgress node to the input nodes that send start_time, stop_time, set, and reset signals.
  3. Connect the output of the workInProgress node to the workInProgressDisplay node.
  4. Configure the input nodes to send signals with the appropriate topics (start_time, stop_time, set, reset) and payload values (boolean).
  5. Deploy the flow, and the workInProgressDisplay node will output a user-friendly message with start time, stop time, and duration of the process in a human-readable format.

Example Flow

Here is an example Node-RED flow that demonstrates the usage of the workInProgress node:

[
    {
        "id": "c2525b09e8138171",
        "type": "tab",
        "label": "WIP",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "8bdc37ee47213adf",
        "type": "inject",
        "z": "c2525b09e8138171",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "start_time",
        "payload": "true",
        "payloadType": "bool",
        "x": 180,
        "y": 120,
        "wires": [
            [
                "8dd08805c5abb1d2"
            ]
        ]
    },
    {
        "id": "95c667e560f17f56",
        "type": "inject",
        "z": "c2525b09e8138171",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "stop_time",
        "payload": "true",
        "payloadType": "bool",
        "x": 190,
        "y": 200,
        "wires": [
            [
                "8dd08805c5abb1d2"
            ]
        ]
    },
    {
        "id": "d2447290d78acae0",
        "type": "inject",
        "z": "c2525b09e8138171",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "set",
        "payload": "true",
        "payloadType": "bool",
        "x": 170,
        "y": 300,
        "wires": [
            [
                "8dd08805c5abb1d2"
            ]
        ]
    },
    {
        "id": "c806bffd58c4e1fa",
        "type": "inject",
        "z": "c2525b09e8138171",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "reset",
        "payload": "true",
        "payloadType": "bool",
        "x": 190,
        "y": 380,
        "wires": [
            [
                "8dd08805c5abb1d2"
            ]
        ]
    },
    {
        "id": "a1abd9822ee56f06",
        "type": "debug",
        "z": "c2525b09e8138171",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 810,
        "y": 220,
        "wires": []
    },
    {
        "id": "8dd08805c5abb1d2",
        "type": "workInProgress",
        "z": "c2525b09e8138171",
        "name": "",
        "topic": "",
        "x": 600,
        "y": 220,
        "wires": [
            [
                "a1abd9822ee56f06",
                "93f125d76af4c5d5"
            ]
        ]
    },
    {
        "id": "f5902b8c0b687600",
        "type": "comment",
        "z": "c2525b09e8138171",
        "name": "Example of node-red-contrib-wip",
        "info": "Here's a simple flow using the workInProgress node to track the duration of a work process:\n\nThe boolean input can be sent with appropriate topics using industrial equipment like PLC\n\nIt is recommended to follow the input sequence of in order of start_time, stop_time, set, reset\n\n\nHarshad Joshi\n",
        "x": 260,
        "y": 60,
        "wires": []
    },
    {
        "id": "93f125d76af4c5d5",
        "type": "function",
        "z": "c2525b09e8138171",
        "name": "readable format",
        "func": "var start_time = msg.payload.start_time\nvar stop_time = msg.payload.stop_time\nvar duration = msg.payload.duration\n\nmsg.payload = \"The process was started at \"+start_time+\" and ended at \"+ stop_time+ \" and total duration of process is is \" + duration\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 850,
        "y": 320,
        "wires": [
            [
                "be195488a9e2b5f5"
            ]
        ]
    },
    {
        "id": "be195488a9e2b5f5",
        "type": "debug",
        "z": "c2525b09e8138171",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1070,
        "y": 320,
        "wires": []
    }
]

Author

Harshad Joshi

License

This project is licensed under the Apache-2.0 License.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss proposed changes or report bugs.

Support

For support, please reach out to Harshad Joshi at [email protected].