JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 361
  • Score
    100M100P100Q82228F

A module to access sound cloud, you can upload tracks, manage playlist etc

Package Exports

  • soundjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (soundjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

#soundjs A module to access soundcloud from nodejs. you can do operations like uploading a track, adding the uploaded track to a specific playlist etc

This module is being built mainly to port multiple audio files from any of your existing repository to soundcloud.

Install

npm install soundjs

Usage

Authenticating with sound cloud

var SoundCloud = require('soundjs');

var sc = new SoundCloud(clientId, clientSecret, userName, password, redirectUri);

Fetching all playlists available (will return a promise)

sc.playlists().then(function(playlist) {
  console.log(playlist);
});

Uploading a new track

var fs = require('fs');
function source() {
  return fs.createReadStream('path/to/your/audio/file');
}
sc.addTrack(title, description, genre, source).then(function(track){
  console.log('uploaded track');
  console.log(track);
});

Complete example of Uploading a new track and adding it to an existing playlist

var sc = new SoundCloud(clientId, clientSecret, userName, password, redirectUri);

sc.playlists().then(function(playlist) {
    var playList = _.findWhere(playlist, {'title': 'playlistname'})

    function source() {
      return fs.createReadStream('path/to/your/audio/file');
    }

    sc.addTrack('test playlist', 'test desc', 'test genre', source).then(function(track) {
        playList.addTrack(track);
    });
})