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

pa-snappa-api-client-node

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pa-snappa-api-client-node

Node.js client for the SNAPPA API by PA

0.4.3
latest
74

Supply Chain Security

100

Vulnerability

99

Quality

76

Maintenance

100

License

Version published
Maintainers
1
Created

Introduction

Welcome to the node.js client for the SNAPPA API by PA (Press Association).

Installation

To utilise the SNAPPA API client for node.js install the npm module.

npm install pa-snappa-api-client

Usage

After the installation of the npm package you can start making calls to the SNAPPA API. Initially you need to instantiate the client, using your API key:

const SnappaClient = require('pa-snappa-api-client');

const client = new SnappaClient({ baseUrl: 'http://snappa.api.press.net/v1-beta', apikey: '<YOUR API KEY' });

Once instantiated you can make requests against the Feeds, Assets and Tags resources provided by the SNAPPA API as follows:

Resources

Feeds

The Feeds resource provides access to feeds.

List Feeds

client
  .feeds()
  .get(function(err, res, feeds) {
    console.log(err);
    console.log(res);
    console.log(feeds);
  });

Get Feed Items

client
  .feeds()
  .id('firehose')
  .sortProperty('modified')
  .limit(50)
  .offset(1)
  .get(function(err, res, feed) {
    console.log(err);
    console.log(res);
    console.log(feed);
  });

Assets

The Assets resource provides access to assets.

List Assets

client
  .assets()
  .query('space')
  .get(function(err, res, assets) {
    console.log(err);
    console.log(res);
    console.log(assets);
  });

Get Asset

client
  .assets()
  .id('abc-123')
  .get(function(err, res, asset) {
    console.log(err);
    console.log(res);
    console.log(feed);
  });

Tags

The Tags resource provides access to tags.

List Tags

client
  .tags()
  .query('space')
  .get(function(err, res, tags) {
    console.log(err);
    console.log(res);
    console.log(tags);
  });

FAQs

Package last updated on 01 Jul 2016

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