🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

mindbrain

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mindbrain

Client for the Mindbrain Music HTTP API

latest
Source
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

Mindbrain API client

Client for the Mindbrain HTTP API

Documentation: https://api.mindbrainmusic.com

Installation

yarn add mindbrain

Usage

Import the Mindbrain client from the mindbrain package, load in your artist name configuration, and you can start using the get() method right away:

import Mindbrain from 'mindbrain'
import config from './package.json'

const mindbrain = new Mindbrain(config)

mindbrain.get('releases').then(releases => console.log(releases))

This will make an HTTP GET request to https://api.mindbrainmusic.com/artists/your-artist-name/releases.json, which retrieves all of the releases for a given artist. The get() method performs an HTTP GET request on the given resource passed in, and returns a Promise object that you can either tack on additional methods to, or use the async / await syntax like so:

import React from 'react'
import Mindbrain from 'mindbrain'

class App extends React.Component {
  this.mindbrain = new Mindbrain({ name: 'wonderbars' })

  async componentWillMount() {
    let releases = await this.mindbrain.get('releases')
    this.setState({ releases })
  }

  // ...
}

Keywords

mindbrain

FAQs

Package last updated on 01 Apr 2018

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