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

synq

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

synq

SYNQ.fm API client

latest
Source
npmnpm
Version
0.1.7
Version published
Maintainers
1
Created
Source

Synq Node.js client library

Client library simplifying use of the SYNQ.fm API from a Node service

The library provides functions mirroring the endpoints in the api, and some simplifying functions.

It makes use of request-promise so all functions returns promises.

Get started

Install:

yarn add synq or npm install --save synq

Require or import:

import Synq from 'synq' or let Synq = require('synq').default;

Usage

Basic examples for all endpoints

import Synq from 'synq'

// Init the library by setting the url and api key
const api = new Synq(process.env.SYNQ_API_KEY, 'https://api.synq.fm/v1/');

// Create a new video object
api.video.create([userdata: Object])
  .then((videoObject) => {
    console.log('Video object created successfully', videoObject)
  })
  .catch((error) => {
    console.log('Error: ', error.statusCode);
    console.log(error.message);
  });

// Get a video object
api.video.details(videoId: string)
  .then(etc... )

// Query video objects by equality to a single key value pair in the metadata
api.video.querySimple(key: string, value: string)
  .then(etc...)

// Query videoobjects by metadata fields by providing filtering code
// ex: 'if (video.views > 3000) { return video }' returns all videos where views > 300
api.video.query(filter: string)
  .then(etc...)

// Update the metadata of a video object by providing code that handles the update
// eks: 'video.userdata.baz = "bar"'
api.video.update(source: string, videoId: string)
  .then(etc...)

// Get upload parameters to Amazon S3.
api.video.upload(videoId: string)
  .then(etc...)

// Get embeddable uploader
api.video.uploader(videoId: string)
  .then(etc...)

// Get streaming details
api.video.stream(videoId: string)
  .then(etc... )

Error handling

If an error happens the promise will reject with an error object.

The library forwards the error from the request library, read their docs for more details

Test

Integration tests are included for all api methods.

You need to set enviroment variable SYNQ_API_KEY=yourAPIKey to run them.

Then do: yarn test

FAQs

Package last updated on 27 Mar 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