3.0.0 • Published 8 years ago
itsthisforthat-node v3.0.0
An asynchronous client library for ItsThisForThat API.
Installation
npm install itsthisforthat-node
Quick Start
The quickest way to get started is by executing following code:
const itsThisForThat = require('itsthisforthat-node')();
try {
let idea = await itsThisForThat.getIdea();
console.log(idea);
} catch (error) {
console.error(error);
}
If everything went well, you'll see something like this in your console:
{
this: 'Salesforce.com',
that: 'Beer'
}
Documentation
getIdea
Requests random idea.
Example
Requests random idea.
try {
let idea = await itsThisForThat.getIdea();
console.log('So, Basically, It\'s Like A ' + idea.this + ' for ' + idea.that);
} catch (error) {
console.error(error);
}
Errors
When errors occur, you receive an error object with default properties as a first argument of the callback.
Tests
To run the test suite, first install the dependencies, then run npm test
:
$ npm install
$ npm test
License
Distributed under the MIT License.