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

jsmx

v0.1.1

Published

A JavaScript library for listening to and emitting management events in node

Downloads

5

Readme

jsmx

Overview

jsmx is a simple way to communicate to your nodejs app. All communications happens using a very simple HTTP API.

Installation

npm install jsmx

Usage

Inside your app, jsmx is nothing more or less than an event emitter (ok, actually an EventEmitter2 https://github.com/hij1nx/EventEmitter2 ). You need only three steps to get on your way:

  1. Start a listener on a port (default is 9002)
  2. Attach an event listener
  3. Send a management event
var mx = require('jsmx');
mx.listen(port); // if no port is specified, defaults to 9002
mx.on('someEvent',function(arg){
	// will be called when 'someEvent' is passed
	// arg is a single JS object
});

To send an event, make a GET request to the host on which your app is running, to the port you specified.

The path (after) the initial slash will be the event name, and the parameters will be converted to a JS object and passed to the callback.

curl http://localhost:9002/foo?a=b&d=1

will create an event "foo" passing the object {a:'b','d':1} to the callbacks

You can also do

curl http://localhost:9002/foo/bar/baz?a=b&d=1

To get an event 'foo/bar/baz'.

Licensing

jsmx is released under the MIT License http://www.opensource.org/licenses/mit-license.php