node-nakiri
v0.1.6
Published
JavaScript library for interacting with the Nakiri API.
Downloads
17
Readme
node-nakiri
Node.js API client for Nakiri.
Getting Started
Before you jump straight into the code, you will need to get an API key for the Nakiri group you want to use the library with. To do this, head over to Nakiri (or whatever instance you want to use) and copy the API key of the group.
You may also want to take note of the group's ID to pass it as a parameter to the client's options.
1. Install the package
npm i node-nakiri
# or
yarn add node-nakiri
2. Import the client
import { Client } from 'node-nakiri';
// or
const { Client } = require('node-nakiri');
3. Set up your event listeners and log in
const client = new Client();
client.on('ready', () => {
console.log('Boom, baby!');
});
client.on('error', (err) => {
mylogger.error('Oh no!', err);
});
client.on('entryAdded', (data) => {
console.log('New entry!', data.value);
});
client.on('entryRemoved', (data) => {
console.log('RIP entry...', data.value);
});
await client.login('YOUR_NAKIRI_API_KEY');
A more detailed API documentation can be found in the library docs.
License
MIT.