0.10.0 • Published 1 year ago
brainshop v0.10.0
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?' }
});
Links
- The Official Website of Brainshop.
- The Official Documentation of Brainshop API.
- The GitHub Repo of this package.
License
See the LICENSE file.
0.10.0
1 year ago