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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mscp

v1.3.7

Published

TBD!

Readme

MSCP: MicroService Communication Platform

TBD!

Sample server/client

const MSCP = require("mscp");
const Handler = require("./handler.js");
const path = require("path");

(async () => {
  let mscp = new MSCP(Handler)
  mscp.server.static(path.join(__dirname, 'www'));
  mscp.start();
})()

The handler constructor argument for MSCP can be either a single class (no namespaces) or an object. If it is an object, then it maps namespaces to handler classes. The root handler is "".

In your handler, you can access the context of the current reqest using the properties:

  • this.mscp: reference to mscp class
  • this.definition: reference to the definition.json file parsed as an object
  • this.global: An empty object that is the same between requests
  • this.request = An object containing path (url path of request), data (all url/post parameters) and req (express req object - has mscp.ip and mscp.accessKey)

Sample browser client:

<script src="/mscp/js/browser.js"></script>
<script src="/mscp/js/jquery.min.js"></script>
<script>
$(function() {
  mscp.ready.then(myFunction)
});

async function myFunction(){
  let value = await mscp.getValue("123")
  console.log(value)
}
</script>

Requirements

You need note 7+ and (if version < 8) the node flag --harmony-async-await. For the browser client, you need Chrome 56 or Firefox 52 (for async/await).

Setup parameters

  • trustProxy: Instructs Express to trust the proxy that sent the request. Only use, when you are behind a proxy that you trust.
  • useForwardedHeader: If set to true, then the security module will check the headers for 'x-forwarded-for' header to get the IP of the client, instead of the proxy server. Only use this, if you are behind a proxy that sets this variable.
  • useRealIPHeader: If set to true, then the security module will check the headers for 'x-real-ip' header to get the IP of the client, instead of the proxy server. Only use this, if you are behind a proxy that sets this variable.

Sample simple UI

TBD

Sample UI Setup, with a single function as entry:

{
  "apps": {
    "": {"title": "Starter", "items": ["services", "kill", "log"], "defaultIndex": 0, "showMenu": false}
  },
  "items": {
    "services": {
      "title":" List services",
      "autorun": true,
      "actions":{
        "<row>": [
          {"call": "log", "title": "View log", "args": {"name": "active.name"}},
          {"call": "setup", "title": "Show setup", "args": {"name": "active.name"}},
          {"call": "gitpull", "title": "Execute: git pull", "args": {"name": "active.name"}, "ui": "notify-result", "notifytimeout": 7000},
          {"call": "npminstall", "title": "Execute: npm install", "args": {"name": "active.name"}, "ui": "notify-result", "notifytimeout": 7000},
          {"call": "kill", "title": "Force stop", "args": {"name": "active.name"}, "ui": "notify-result"},
          {"call": "enableService", "title": "Enable", "args": {"name": "active.name"}, "ui": "notify-result", "rerunParentAfter": true},
          {"call": "disableService", "title": "Disable", "args": {"name": "active.name"}, "ui": "notify-result", "rerunParentAfter": true},
          {"type": "link", "url": "<curhostnoport>:<active.http_port>/mscp", "title": "Open: MSCP Setup"},
          {"type": "link", "url": "<curhostnoport>:<active.http_port>/api/browse", "title": "Open: API Browser"},
          {"type": "link", "url": "<curhostnoport>:<active.http_port>", "title": "Open: Root"}
        ],
        "": [
          {"type": "link", "item": "services", "title": "Refresh"}
        ]
      }
    },
    "log": {"title":"Get log"},
    "kill": {"title":"Restart service"}
  }
}

Reserved URL parameters:

  • accessKey: used when securing (som parts of) the server with access keys
  • responseType: can be used to set response type to XML instead of JSON

CORS

You can enable CORS by setting ''allowedOrigins'' in ''setup.json'' to the domains that should be allowed. It supports regexps.

If you want to allow all cors (send ), then just set it to '''', would would make it use the cors npm module with default options.

If you want to allow all, including credentials, then set it to ''**''.

Access keys

Access keys expire every 18 days by default, but can be extended by setting ''accessKeyExpirationDays'' in setup.json.

Depend on download function

You can access the file if you call a download function dependency like this:

let file = await this.mscp.files.download.call(this, "123")
file.toBuffer().toString()