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

sudosignals_nodeplugin

v0.3.1

Published

A NodeJS plugin for the [sudoSignals](https://sudosignals.com) monitoring and remote operation service.

Downloads

1

Readme

SudoSignals Node Plugin

A NodeJS plugin for the sudoSignals monitoring and remote operation service.

What is sudoSignals?

sudoSignals is an application monitor and remote operation service. With Signals, a local service application communicates with an applications locally, and then acts as a bridge to a remote, web Dashboard. It's important to understand the mechanics of how Signals operates in order to best take advantage of this tool, and have a seamless remote operation experience.

Lets go already!

This plugin operates by communicating to the sudoSignals local service installed on your machine. For more information on how to install check out the getting started instructions.

To install the sudoSignals plugin into your nodeJS project use the following:

npm i sudosignals_nodeplugin

You can then bring the sudoSignals code into your project with the following:

//require the signals plugin 
var SignalsPlugin = require('sudosignals_nodeplugin').SignalsPlugin

//Insert Process id from process configuration page in dashboard
const PROCESS_ID = "PROCESS_ID_HERE"

//Create plugin.
var myPlugin = new SignalsPlugin(id=PROCESS_ID, onStart=()=>{
	console.log('Plugin has connected to signals service.')
	
	// Send a log to the SudoSignals Dashboard
	myPlugin.Log("Hello SudoSignals!", logLevel=0)
})

Creating Logs

Logs are a great tool for getting contextual information about your installation in one place. Here is an example of adding a Log:

//Create plugin.
var myPlugin = new SignalsPlugin(id=PROCESS_ID, onStart=()=>{
	console.log('Plugin has connected to signals service.')
	
	// Send a log after SudoSignals connection starts
	myPlugin.Log("Hello SudoSignals!", logLevel=0) 			// sends a "INFO" log
	myPlugin.Log("Uh Oh SudoSignals!", logLevel=1) 			// sends a "WARN" log
	myPlugin.Log("SudoSignals, There is a problem...", logLevel=2) 	// sends a "CRIT" log
})

Creating Reports

Reports are one of the ways sudoSignals enables you to monitor whats happening in your installation. Here's how we set them up with the nodeJS plugin:

// Create a report definition.
var Report1Definition = {
	label: "My Report",
	value: 0, // value should always be a number.
}

// Add the report to plugin
var Report1 = myPlugin.AddReport(Report1Definition)

// Update the report value in your code regularly.
setInterval(()=>{
	// Set value of report.
	/* 
		Note - updates are pulled from the service and may not update as
		quickly as you set them
	*/ 
	Report1.SetValue(Report1.value+1)
}, 3000)

Creating Controls

Controls are a great way of controlling your project when you can't physically access the systems its on. There are many types of supported controls. Here is how to create them:

//Create a control definition
/*
Styles currently supported by sudoSignals:
 - Int
 - Float
 - Str	
 - Menu
 - RGB
 - RGBA 
 - XY
 - XYZ
 - UV
 - UVW
 - WH
*/
var Control1Definition = {
	name: "MyInt",
	label: "My Int",
	style: "Int",
}

//Add control to plugin
var Control1 = myPlugin.AddControl(Control1Definition)

//Create a function to handle updates to the control
const updateFunction = (control, currentValue)=>{
	console.log(control.label+' update!')
	console.log("Current value is:", currentValue)
}

//Set up control listener
Control1.on("control-Update", updateFunction)