1.0.0-alpha.7 • Published 6 years ago

@drush-io/api-client v1.0.0-alpha.7

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

drush.io API Client (JavaScript)

A JavaScript API client for drush.io. Client-side and server-side compatible.

Travis build status Code Climate Test Coverage Dependency Status devDependency Status

Installation

npm install @drush-io/api-client --save

Usage

// Instantiate the API client using an API token from an environment variable.
var DrushIOClient = require('@drush-io/api-client'),
    client = new DrushIOClient(process.env.DRUSHIO_API_TOKEN);

// Queue a run of the "backup-prod" job on the "my-corp" project.
var runQueued = client.projects('my-corp').jobs('backup-prod').runs().create();

// All actions return promises--you can react to them like this.
runQueued.then(function onceQueued(run) {
  console.log(run);
});