Socket
Socket
Sign inDemoInstall

playlist-js

Package Overview
Dependencies
3
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    playlist-js

Javascript Playlist API client for NodeJS or a browser using promises or callbacks


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Install size
1.09 MB
Created
Weekly downloads
 

Readme

Source

Playlist.js

Circle CI npm Bower

Playlist.js provides a minimal higher-level wrapper around Playlist's API. It can be used in Node.js or in the browser as an AMD module or standalone (generated via browserify).

Overview

Key Features

  • Works in Node.js or in the browser (available on npm and bower registries)
  • Exposes all Playlist API endpoints
  • Supports ETag caching
  • Paged results
  • Node-style callbacks as well as optional Promise support

Setup

Browser

<script src="dist/playlist.js"></script>

To support promises (optional), Playlist.js depends on a promise library. Currently jQuery, AngularJS, or a promise polyfill (like es6-promise) are supported. Remember to include the library before Playlist.js.

Node.js

var Playlist = require('playlist-js');

Usage

First, create a Playlist instance:

var playlist = new Playlist({

  // Authentication requires either a username / password combo or an OAuth key
  username: 'user',
  password: 'pass',

  // for OAuth
  token: 'token',

  // (optional) Switch on whether to use ETags
  // Defaults to true
  useETags: true,

  // (optional) switch to use HTTP POST instead of PATCH.
  // Defaults to false.
  usePostInsteadOfPatch: false,

  // (optional) API root URL.
  // Defaults to 'https://api.playlist.com'.
  // Most likely you will never change this value.
  rootURL: 'https://api.playlist.com',

  // (optional) Sets the Accept header (and thus the API version).
  // Defaults to 'application/vnd.playlist.v1+json'
  // Most likely you will never change this value.
  acceptHeader: 'application/vnd.playlist.v1+json'

});

Examples

Advanced

Contributing

Please fork this repository and contribute back using [pull requests](https://github.com/playlist-api/playlist-js/pulls.

Any contributions, large or small, major features, bug fixes, additional language translations, unit/integration tests are welcomed and appreciated but will be thoroughly reviewed and discussed.

Keywords

FAQs

Last updated on 09 Jan 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc