🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

svb-client

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svb-client

NodeJS request client for SVB API

2.6.1
latest
70

Supply Chain Security

100

Vulnerability

79

Quality

76

Maintenance

100

License

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created

svb-client

NodeJS library which helps you make GET and POST requests to the SVB API.

If you received a test API key and no HMAC SECRET, you should use a non-empty ASCII string as a placeholder (for example "HMAC SECRET").

Installation

npm install svb-client --save

Usage

const SVB = require('svb-client');

let client = new SVB({
  API_KEY: '',
  // HMAC_SECRET is optional during API tests
  HMAC_SECRET: '',
  // options below are optional, depending on use-case
  BASE_URL: ''
});

client.get('/v1', 'test=1', (err, data) => {
  ...
});

client.post('/v1', { "data": "foo" }, (err, data) => {
  ...
});

// similar
client.patch(url, jsondata, callback);
client.delete(url, callback);

// uploading a file (png, jpg, or pdf)
const fs = require('fs');
client.upload('/v1/files', fs.createReadStream(__dirname + '/file.png'), 'image/png', (err, data) => {
  ...
});

FAQs

Package last updated on 12 Jun 2017

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