todoist-nodejs
The unofficial Todoist Node.js API library. Use todoist SYNC API.
Installation
npm install node-todoist
or
yarn add node-todoist
Usage
To get started create new instance of todoist, pass it your API token and make sync to login.
const todoist = require('todoist-nodejs');
const api = new todoist(<TOKEN_API>);
api.sync();
After sync
you can do everything you want. Some examples are below. Pay attention, that any changes first of all are placed in queue. So you should call commit method to sync it with todoist servers.
api.commit();
Examples
Performing a add item
request
const todoist = require("../build/index");
const api = new todoist(process.env.TOKEN_API);
api
.sync()
.then(() =>
api.items.add('task1', {
priority: 4,
due: {
string: 'today'
}
})
)
.then(() => api.commit());
Development
- Clone repo and install dependencies.
npm install
- Create '.env' (.env.example is on the root of the repo) and insert your TOKEN_API.
- Build it:
npm run build
Before every commit it will be rebuilded using pre-commit hook.
- Use examples to test your changes.
Contributing
Feel free to improve the code and implement new features.