node-codementor
is a npm package that lets you access the codementor api in your node projects.
npm install --save node-codementor
To use the package import the package into your project and then instantiate a new codementor class with your api key as a parameter (visit https://www.codementor.io/settings/api to get a key.)
const Codementor = require('node-codementor');
const codementor = new Codementor('xxxxxxxxxxxxxxx');
The codementor class exports the following methods;
Method | Parameter | Optional | Format | Details | Http Method |
---|---|---|---|---|---|
directPayments() | - | - | - | https://dev.codementor.io/docs#direct-payments | GET |
freelanceJobs() | starting_after | true | xxxxxxxx | https://dev.codementor.io/docs#freelance-jobs | GET |
monthlyPayouts() | payout_month | false | yyyy-mm | https://dev.codementor.io/docs#list-payouts-by-month | GET |
sessions() | starting_after | true | xxxxxxxx | https://dev.codementor.io/docs#list-all-sessions | GET |
confirmSession() | scheduled_session_id | false | xxxxxxxx | https://dev.codementor.io/docs#confirm | POST |
rescheduleSession() | scheduled_session_id | false | xxxxxxxx | https://dev.codementor.io/docs#reschedule | POST |
declineSession() | scheduled_session_id | false | xxxxxxxx | https://dev.codementor.io/docs#decline | POST |
All methods are promisified.
To get all your sessions you can use the following code;
//sessions() also takes an optional `starting_after` argument.
codementor.sessions().then(sessions =>{
console.log(sessions)
}).catch(error =>{
console.log(error)
});
Proper Examples Tests
Contributions are welcome! Please File any issues or make a Pull Request.
Distributed under the MIT License. See LICENSE
for more information.
Copyright © 2020 Seyi Adeleke