Playlist.js
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({
username: 'user',
password: 'pass',
token: 'token',
useETags: true,
usePostInsteadOfPatch: false,
rootURL: 'https://api.playlist.com',
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.