node-codementor
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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;

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

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    0

Package Sidebar

Install

npm i node-codementor

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

10.9 kB

Total Files

16

Last publish

Collaborators

  • seyi_adeleke