1.0.0 • Published 5 years ago

node-codementor v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

About

node-codementor is a npm package that lets you access the codementor api in your node projects.

Installation

npm install --save node-codementor

Getting Started

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 Codementot('xxxxxxxxxxxxxxx');

The codementor class exports the following methods;

MethodParameterOptionalFormatDetailsHttp Method
directPayments()---https://dev.codementor.io/docs#direct-paymentsGET
freelanceJobs()starting_aftertruexxxxxxxxhttps://dev.codementor.io/docs#freelance-jobsGET
monthlyPayouts()payout_monthfalseyyyy-mmhttps://dev.codementor.io/docs#list-payouts-by-monthGET
sessions()starting_aftertruexxxxxxxxhttps://dev.codementor.io/docs#list-all-sessionsGET
confirmSession()scheduled_session_idfalsexxxxxxxxhttps://dev.codementor.io/docs#confirmPOST
rescheduleSession()scheduled_session_idfalsexxxxxxxxhttps://dev.codementor.io/docs#reschedulePOST
declineSession()scheduled_session_idfalsexxxxxxxxhttps://dev.codementor.io/docs#declinePOST

Example

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)
});

Todo

Proper Examples Tests

Contributions

Contributions are welcome! Please File any issues or make a Pull Request.

License

Distributed under the MIT License. See LICENSE for more information.

Copyright © 2020 Seyi Adeleke