2.0.0 • Published 9 months ago
codewars-node-api v2.0.0
codewars-node-api
Utility to call the codewars' public api from nodejs.
Not affiliated with codewars.
Installation
Using npm:
npm i codewars-node-apiNote: 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 helpGetting user example
codewars-node-cli user get bradtaniguchiGetting authored challenges by user example
codewars-node-cli challenges authored bradtaniguchiGetting completed challenges by user example
codewars-node-cli challenges completed bradtaniguchiContributing
See CONTRIBUTING and review the CODE_OF_CONDUCT.
License
See LICENSE