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

nodesimulator

v0.0.7

Published

nodesimulator CLI

Downloads

2

Readme

nodesimulator CLI

A CLI for nodesimulator.

Installing

sudo npm i -g nodesimulator

configuration

Create the configuration file

sudo mkdir -p /etc/nodesimulator/
sudo touch /etc/nodesimulator/nodesimulator.yaml

Although it is possible to provide all configuration options on the commandline, it is easier to make some configurations in /etc/nodesimulator/nodesimulator.yaml. For this you can use this template:

sysAdmin:
    username: [email protected]
    password: examplePwd
server: "https:/exampleHost.com"

If you get a yaml error, please just copy the template above and replace the values.

Downloading data

Please be sure to first create /usr/share/nodesimulator/data or run as root to have the directory created. You may also have to run as root if the directory is owned by root, which will be the case if the directory is created by root.

You can download data from a single device, a list of devices or all devices for a customer.

For a single device, use: nodesimulator download -T TenantName -D deviceName

For a several devices, use: nodesimulator download -T TenantName -D device1Name,device2Name,..,deviceNName

For all devices, use: nodesimulator download -T TenantName -C CustomerName -D "*". (-D is optional though).

download [-S server -U systemAdmin -P systemAdminPwd if not in /etc/nodesimulator/nodesimulator] -T tenant [-D device default is ("*") if -C is included so that all devices for customer. Separate list of devices with ,] [-B start Date default (2018-01-01/earliest date for device) -E end date default now]

upload

To upload data:

  1. go to cd /usr/share/nodesimulator/data
  2. rename the file containing the data you want to upload to have the name of the device you want to upload to: cp OLDDEVICENAME NEWDEVICENAME. Ignore this if you are uploading to the same device from which the data was downloaded.

You can upload data from a single device, a list of devices or all devices for a customer.

For a single device, use: nodesimulator upload -T TenantName -D deviceName -F field1,field2,...,fieldN

For a several devices, use: nodesimulator upload -T TenantName -D device1Name,device2Name,..,deviceNName -F field1,field2,...,fieldN

For all devices, use: nodesimulator upload -T TenantName -C CustomerName -D "*" -F field1,field2,...,fieldN. (-D is optional though). This will rarely be of any important use

Note: If you use -f when uploading, then all data for the device will be deleted. If you'd like to filter fields or duration for which you want data to be deleted, then use nodesimulator delete

upload [-S server -U systemAdmin -P systemAdminPwd if not in /etc/nodesimulator/nodesimulator] -T tenant [-D device default is ("*") if -C is included so that all devices for customer. Separate list of devices with ,] [-B start Date default (earliest date for device) -E end date default now -F fields to upload defaults to "*" for all fields -f force deletion of all existing data for device before uploading new data -d delayMs - interval at which data is uploaded to allow for rule chains to process. defaults to 100 -O deletes data from device and stops there]

NOTE: The server is not able to handle very frequent requests. So we recommend that you use a delay of 800 ms and more when uploading.

delete

USE WITH CAUTION. You may end up deleting all data for all devices of a tenant account

If you need to delete data from a device, you can use:

nodesimulator delete -T WaterMeasurements -D testPrepaidMeter -F "volume,amount,valveState"

To delete all fields, use -F "*" or leave it out.

You can delete data for several devices using -D device1Name,device2Name,..,deviceNName

You can also select the range for which you want the data deleted by supplying -B begin and -E end otherwise the range is from the earliest entry to the last.