New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

primus-requests

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

primus-requests

Send named requests and receive responses with primus

latest
Source
npmnpm
Version
0.2.2
Version published
Weekly downloads
13
116.67%
Maintainers
1
Weekly downloads
 
Created
Source

Primus Requests

Send a named request with data and attach a callback to get the response.

Installation

npm install primus-requests --save

After installing with npm add primus-requests as a primus plugin

{
    transformer: ...,
    plugin: {
        requests: require('primus-requests')
    }
}

Usage

Sending requests is identical on the server and the client.

send(name, [data, callback])

(primus || spark).send('message', 'hello', (data) => {

    // Do something with the response in data

})

on(name, handler)

Responding to requests is also identical on the server and client.

(primus || spark).on('hello', (data, response) => {

    // Data is what is sent with the request

    // Response is a callback to send data back
    response('Well hey there')

})

Keywords

primus

FAQs

Package last updated on 15 Jan 2018

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