Package Exports
- algorithmia
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 (algorithmia) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
algorithmia.js
A nodejs library for calling algorithms on Algorithmia.com with partial support fo the DataAPI
Usage
Add algorithmia to your package.json
npm install --save algorithmiaCall any algorithm on the Algorithmia platform:
var algorithmia = require("algorithmia");
var client = algorithmia(process.env.ALGORITHMIA_API_KEY);
var input = "5";
client.algo("docs/JavaAddOne").pipe(input).then(function(response) {
if (response.error) {
console.log(response.error);
} else {
console.log(response.get());
}
});Create and read files (strings and JSON)
var algorithmia = require("algorithmia");
var client = algorithmia(process.env.ALGORITHMIA_API_KEY);
var content = "Hello!";
// using putString, other options: getString, putJson, getJson
client.file("data://.my/Test/foo.txt").putString(content, function(response) {
if (response.error) {
console.log(response.error);
} else {
console.log(response.result);
}
});See /examples for more.
Build
Currently tested with nodejs v0.10.36
# install dev dependencies and gulp-cli wrapper
npm install
npm install -g gulp-cli
# compile coffeescript
gulpTODO
* Add tests
* Support DataAPI directory functions