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

piper-mgr

v0.1.0

Published

Node wrapper for Piper APIs

Readme

Quick start

  1. Install Node.JS on your computer.

  2. Setup your project

    Create a new Node.JS app :

    $ mkdir myapp
    $ cd myapp
    $ npm init
    ...

    Add node-piper as a dependency in your package.json

      "dependencies": {
        "node-piper": "0.1.0"	
      },	

    Execute npm install in your current folder to fetch the dependencies

    Create an index.js file in myapp directory containing:

    var piper = require('piper-mgr');
    var ACCESS_TOKEN = "IQ77NWUPUMNBYEUEKRTWU3VDR5YSLHTA"; // A unique access token to authenticate your request
       
    console.log("Managing piper services with the Piper API");
       
    var client = {
        "name": "ACME Company",
        "handle": "acme",
        "slackToken": "xoxb-AB0923F-09LSDKFJWOFKLS-LKALIWE099",
        "adminContact": "Martin Don",
        "adminEmail": "[email protected]",
      }
    
    piper.registerClient(ACCESS_TOKEN, client, function (err, res) {
        console.log("Response from Piper for registerClient: ");
        if (err) console.log("Error: ", err);
        console.log(JSON.stringify(res, null, " "));
    });
       
    piper.connect(ACCESS_TOKEN, "acme", function (err, res) {
        console.log("Response from Piper for new connection: ");
        if (err) console.log("Error: ", err);
        console.log(JSON.stringify(res, null, " "));
    });
    
    piper.disconnect(ACCESS_TOKEN, "acme", function (err, res) {
        console.log("Response from Piper for end connection: ");
        if (err) console.log("Error: ", err);
        console.log(JSON.stringify(res, null, " "));
    });
    
    piper.getClient(ACCESS_TOKEN, "acme", function (err, res) {
        console.log("Response from Piper for retrieve client details: ");
        if (err) console.log("Error: ", err);
        console.log(JSON.stringify(res, null, " "));
    });
    
    piper.getClients(ACCESS_TOKEN, function (err, res) {
        console.log("Response from Piper for retrieve all client details: ");
        if (err) console.log("Error: ", err);
        console.log(JSON.stringify(res, null, " "));
    });
    
    piper.getConnection(ACCESS_TOKEN, "acme", function (err, res) {
        console.log("Response from Piper for retrieve connection details: ");
        if (err) console.log("Error: ", err);
        console.log(JSON.stringify(res, null, " "));
    });
    
    piper.getConnections(ACCESS_TOKEN, function (err, res) {
        console.log("Response from Piper for retrieve all active connections: ");
        if (err) console.log("Error: ", err);
        console.log(JSON.stringify(res, null, " "));
    });
    
  3. Start your app

$ node index.js
Response from Piper for registerClient:
Client acme successfully registered and activated

Response from Piper for new connection:
{
 "status": "Connected",
 "client": {
    "_id": "54f1d37614ef3039468cd086",
    "name": "ACME Company",
    "slackHandle": "acme",
    "slackToken": "xoxb-AB0923F-09LSDKFJWOFKLS-LKALIWE099",
    "adminContact": "Martin Don",
    "adminEmail": "[email protected]"
    "isActive": true,
    "__v": 0
  }
}
...

Examples

API

registerClient

The registerClient function registers a new client and activates a slack connection. The function takes 3 parameters:

  • access_token: Your access token for authentication
  • client: JSON object with details of the client you want to register
  • callback(error, response): A callback function get 2 arguments:
    1. An error when applicable
    2. A JSON object containing the Piper response
var piper = require('piper-mgr');
var client = {
    "name": "ACME Company",
    "handle": "acme",
    "slackToken": "xoxb-AB0923F-09LSDKFJWOFKLS-LKALIWE099",
    "adminContact": "Martin Don",
    "adminEmail": "[email protected]",
  }

piper.registerClient(ACCESS_TOKEN, client, function (err, res) {
    console.log("Response from Piper for registerClient: ");
    if (err) console.log("Error: ", err);
    console.log(JSON.stringify(res, null, " "));
});

connect

The connect function creates a slack connection for a registered client. The function takes 3 arguments:

  • access_token: Your access token for your instance
  • handle: The unique slack handle of the clients slack instance .slack.com
  • callback(error, response): A callback function get 2 arguments:
    1. An error when applicable
    2. A JSON object containing the Piper response
var piper = require('piper-mgr');
piper.connect(ACCESS_TOKEN, "acme", function (err, res) {
    console.log("Response from Piper for new connection: ");
    if (err) console.log("Error: ", err);
    console.log(JSON.stringify(res, null, " "));
});

disconnect

The disconnect function ends an active connection. The function takes 3 arguments:

  • access_token: Your access token for your instance
  • handle: The unique slack handle of the clients slack instance .slack.com
  • callback(error, response): A callback function get 2 arguments:
    1. An error when applicable
    2. A JSON object containing the Piper response
var piper = require('piper-mgr');
piper.disconnect(ACCESS_TOKEN, "acme", function (err, res) {
    console.log("Response from Piper for end connection: ");
    if (err) console.log("Error: ", err);
    console.log(JSON.stringify(res, null, " "));
});

getClient

The getClient function retrieves the details of a registered client. The function takes 3 arguments:

  • access_token: Your access token for your instance
  • handle: The unique slack handle of the clients slack instance .slack.com
  • callback(error, response): A callback function get 2 arguments:
    1. An error when applicable
    2. A JSON object containing the Piper response
var piper = require('piper-mgr');
piper.getClient(ACCESS_TOKEN, "acme", function (err, res) {
    console.log("Response from Piper for retrieve client details: ");
    if (err) console.log("Error: ", err);
    console.log(JSON.stringify(res, null, " "));
});

getClients

The getClients function retrieves an array of all registered clients. The function takes 2 arguments:

  • access_token: Your access token for your instance
  • callback(error, response): A callback function get 2 arguments:
    1. An error when applicable
    2. A JSON object containing the Piper response
var piper = require('piper-mgr');
piper.getClients(ACCESS_TOKEN, function (err, res) {
    console.log("Response from Piper for retrieve all client details: ");
    if (err) console.log("Error: ", err);
    console.log(JSON.stringify(res, null, " "));
});

getConnection

The getConnection function retrieves the details of an active connection for a registered client. The function takes 3 arguments:

  • access_token: Your access token for your instance
  • handle: The unique slack handle of the clients slack instance .slack.com
  • callback(error, response): A callback function get 2 arguments:
    1. An error when applicable
    2. A JSON object containing the Piper response
var piper = require('piper-mgr');
piper.getConnect(ACCESS_TOKEN, "acme", function (err, res) {
    console.log("Response from Piper for retrieve connection details: ");
    if (err) console.log("Error: ", err);
    console.log(JSON.stringify(res, null, " "));
});

getConnections

The getConnections function retrieves an array of all registered connections. The function takes 2 arguments:

  • access_token: Your access token for your instance
  • callback(error, response): A callback function get 2 arguments:
    1. An error when applicable
    2. A JSON object containing the Piper response
var piper = require('piper-mgr');
piper.getConnections(ACCESS_TOKEN, function (err, res) {
    console.log("Response from Piper for retrieve all active connections: ");
    if (err) console.log("Error: ", err);
    console.log(JSON.stringify(res, null, " "));
});