Socket
Book a DemoInstallSign in
Socket

dray-client

Package Overview
Dependencies
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dray-client

Node.js wrapper for managing Dray jobs

0.0.15
latest
Source
npmnpm
Version published
Weekly downloads
66
-79.44%
Maintainers
5
Weekly downloads
 
Created
Source

Build Status Coverage Status

Usage

Before creating jobs, you need to initialize the job manager:

import { DrayManager } from 'dray-client';

let manager = new DrayManager(
	'http://0.0.0.0:3000',   // Dray URL
	'redis://127.0.0.1:6379' // Redis URL
);

Fire and forget

let job = manager.createJob();

job.addStep('foo/bar') // Container to be run
   .submit(); // Fire and forget!

Wait for result

let job = manager.createJob();
job.setInput('foo') // Data passed to container
   .addStep('centurylink/upper'); // Container to be run
// Fire and wait for promise
job.submit().then((value) => {
	console.log("Result:", value);
}, (reason) => {
	console.error("Something bad happened:", reason)
});

Start compilation job

import { BuildpackJob } from 'dray-client';
let compilation = new BuildpackJob(manager);
compilation.addFiles([
	{name: 'foo.ino', data: new Buffer()}
]);
compilation.setEnvironment({
	PLATFORM_ID: 6
});
compilation.setBuildpacks([
	'particle/buildpack-wiring-preprocessor',
	'particle/buildpack-particle-firmware:0.5.1-photon'
]);
compilation.submit().then((binaries) => {
	// Do something with binaries
}, (reason) => {
	console.error("Compilation error:", reason)
});

API Reference

Development

Releasing

  • Prebuid dist directory using npm build
  • Bump version with npm version <major|minor|patch>
  • Push the repo
  • Publish on npm: npm publish

FAQs

Package last updated on 27 Jun 2017

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.