npm.io
0.10.0 • Published 3 years ago

brainshop

Licence
MIT
Version
0.10.0
Deps
0
Size
6 kB
Vulns
0
Weekly
0
Stars
1

brainshop

A simple module to interact with the Brainshop.ai API.

Install

npm install brainshop
yarn add brainshop

How to use

Import the brainshop module in your code.

const Brainshop = require("brainshop");

Declare a variable constructing the Brainshop class. Also Make sure to pass the Brain ID as bid and API Key as key.

const brain = new Brainshop({
    bid: "174633",
    key: "vd372tjTuRsKdh1C"
});

To make the API call, you have to use the get method of Brainshop class. You will pass the message in the first parameter.

brain.get("Hello Robot!").then((response) => {
    console.log(response); // { cnt: 'Hi, my friend, do you need me to do calculation for you?' }
});

// Or
brain.get("Hello Robot!", (response) => {
    console.log(response); // { cnt: 'Hi, my friend, do you need me to do calculation for you?' }
});

License

See the LICENSE file.

Keywords