Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

beatport

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beatport

Beatport API client for Node.js

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

node-beatport

Beatport API client - resources as methods, also attempts to improve the resulting data to make them more useful.

Installation

npm install beatport

Usage / Examples


var Beatport = require('beatport')

// initialize and configure client
var bp = Beatport({ perPage: 10, sortBy: 'releaseDate desc' })

// resources (i.e: featured/releases) as methods (camelCased, i.e: featuredReleases)
//
// a search for tracks by 'digweed'
bp.search({ query: 'digweed', facets: { fieldType: [ 'track' ] } }, function(err, results, metadata) {
  results.forEach(function(track) {
    console.log(track.title)
  })
})

// get tracks of genre Tech House and performers John Digweed and Nick Muir
bp.tracks({
  facets: {
    genreName: 'Tech House'
  , performerName: [ 'John Digweed', 'Nick Muir' ]
  }
, page: 1
}, function(err, results, metadata) {
  results.forEach(function(track) {
    console.log(track.title)
  })
})

// get details of label with id 804
bp.labelsDetail({ id: 804 }, function(err, results, metadata) {
  results.mostPopularReleases.forEach(function(release) {
    console.log(release.name, release.artists.names)
  })
})

Improving the Beatport data

In order to make the resulting Beatport data more Javascript-friendly, by default the client attempts to improve the data. If you don't want this behavior, just initialize the client with an improve: false option.

This is what it does, so far:

  • Adds a .camelot field containing the Camelot system representation of the track key (ie '8B')
  • Finds remixers in the .artists field and extracts them to their own array .remixers
  • Parses the ids and names of artists and remixers and creates arrays as properties in the Object type of the existing arrays: .artists.names, .artists.ids, .remixers.names, .remixers.ids
  • Converts date strings to Date objects
  • Adds .title field to the tracks, with a proper representation of the track, like this: Artist Name - Track Name (MixName)

FAQs

Package last updated on 09 Jun 2011

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc