functions

1.0.9 • Public • Published

Computes.io functions

This NPM module allows developers to easily add common supercomputer functions to their computes.io apps.

Getting Started

npm install functions

var functions = require("functions");

How to use functions

functions.list

returns: [ 'sentiment', 'md5cracker', "nextprime" ]

functions.sentiment

returns: sentiment function

functions.md5cracker

returns: MD5 cracker function

functions.nextprime

returns: Next Prime function

Computes.io Example

var computes = require("computes");
var functions = require("functions");

var options = {
  domain: "{{user.domainKey}}",
  priority: "normal",  //'low', 'normal' & 'high'
  ttl: 60000,  // milliseconds
  delay: 0 //milliseconds
}

var job = computes.connect();

job.on("ready", function (){
  var data = "i love skynet";
  job.compute(functions.sentiment, data, options);
});

job.on("result", function (result){
  console.log(result);
  job.disconnect();
});

Package Sidebar

Install

npm i functions

Weekly Downloads

112

Version

1.0.9

License

ISC

Last publish

Collaborators

  • chrismatthieu