0.1.1 • Published 8 years ago

cortical v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Cortical

Promise based wrapper for the Cortical.io Retina API

Installation

npm install cortical --save

Usage

Create a new client instance

const Cortical = require('cortical');
const client = new Cortical({ key: YOUR_API_KEY });

Send a GET request

client.get('terms', { term: text })
	.then(result => console.log(result));

// [
//   {
//     "term": ...,
//     ...
//   }
// ]

Send a POST request

client.post('text', text)
	.then(result => console.log(result));

// [
//   {
//     "positions": [...]
//   }
// ]

Get a fingerprint for a text

client.getFingerprint(text)
	.then(result => console.log(result));

// [2,3,65,66...]

Get fingerprints for an array of texts

client.getFingerprints(texts)
	.then(results => console.log(results));

// [
//   [2,3,65,66...],
//   ....
// ]
0.1.1

8 years ago

0.1.0

8 years ago