JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 49
  • Score
    100M100P100Q16656F
  • License MIT

Client library for calling algorithms in the Algorithmia marketplace

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 for the DataAPI

Usage

Add algorithmia to your package.json

npm install --save algorithmia

Call 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.

Building the client

This project uses gulp to compile coffeescript.

# install dev dependencies and gulp-cli wrapper
npm install
npm install -g gulp-cli

# compile coffeescript
gulp