Options
All
  • Public
  • Public/Protected
  • All
Menu

codewars-node-api

codewars-node-api

Utility to call the codewars' public api from nodejs.

Not affiliated with codewars.

npm license github workflow github issues

Installation

Using npm:

npm i codewars-node-api

Note: add --save if you are using npm < 5.0.0

Example Usage

node.js

const { CodewarsV1Api } = require('codewars-node-api');

const cwApi = new CodewarsV1Api();

const userId = 'bradtaniguchi';
cwApi.getUser(userId).then((user) => {
console.log(user.name); // Brad
});

TypeScript/esm

import { CodewarsV1Api } from 'codewars-node-api';

const cwApi = new CodewarsV1Api();

const userId = 'bradtaniguchi';
cwApi.getUser(userId).then((user) => {
console.log(user.name); // Brad
});

Documentation

All code documentation is available here: https://bradtaniguchi.dev/codewars-node-api/

CLI

This package comes with a CLI interface that can be used to interact with the API directly from your terminal. This could be useful as a quick reference, or working with other command-line tools.

Usage

codewars-node-cli help

Getting user example

codewars-node-cli user get bradtaniguchi

Getting authored challenges by user example

codewars-node-cli challenges authored bradtaniguchi

Getting completed challenges by user example

codewars-node-cli challenges completed bradtaniguchi

Contributing

See CONTRIBUTING and review the CODE_OF_CONDUCT.

License

See LICENSE

Generated using TypeDoc