Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sidekick

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sidekick

Realtime site tools

  • 0.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by62.5%
Maintainers
1
Weekly downloads
 
Created
Source

Sidekick

Realtime site monitoring helper. Sidekick provides a few things:

  1. Integrate a pub/sub server into your server.
  2. Insight to incomming requests and the ability to react to them in code.
  3. Multiplexing http requests. This is especially useful for testing live requests against a dev environment.

Please look into the examples directory for usage.

Components in Sidekick

Server

The sidekick server is a class that offers both the server and the middleware (connect) for your base application.

  var sidekick = require('./sidekick');
  sidekick.listen(7777);
  originalApp.use(sidekick.connect());
  originalApp.listen(7778);

At this point, you have your app running on port 7778 and a sidekick port running on 7777. If you create a client to access http://localhost:7777/data, you will see an incoming stream of json lines representing the requests coming in from the original app.

Note: Accessing it in the browser is not a good way to view the data, you should use some kind of streaming programatic client

Client

The client is a way to tap into the sidekick server and subscribe to requests.

  var client = sidekick.Client(host, port);
  client.on('sidekick.requests', function (data) {
    /*
     * data == {
     *   headers: <hash>,
     *   path: <string>,
     *   method: <integer>
     * }
     *
     # ... do something ... 
     */
  });

Keywords

FAQs

Package last updated on 20 Jun 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc