npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

codewars-node-api

v1.1.0

Published

codewars nodejs api client, with types

Downloads

15

Readme

codewars-node-api

Utility to call the codewars' public api from nodejs.

Not affiliated with codewars.

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

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/

Tooling Scripts

Below is docs on using the tools scripts directly by using the npm scripts. Useful for testing, or just getting raw data directly outputted directly into stdout. These scripts can be used after cloning this repo locally and testing against the actual api calls your making.

note all npm run commands can be passed the --silent flag to suppress the first 2 lines printed, leaving only the raw JSON data being printed out to stdout. This could be useful if your want to save a given request to a file, or "pipe" it in your shell.

get-user

Returns a single user.

npm run get:user <username | userId>

get-completed-challenges

Returns the list of completed challenges for the given user. Includes pagination.

npm run get:completed-challenges <username | userId> [page = 0]

get-authored-challenges

Returns a list of authored challenges made by the user.

npm run get:authored-challenges <username | userId>

get-code-challenge

Returns a single code challenge.

npm run get:code-challenge <challengeId | challenge-slug>

Contributing

See CONTRIBUTING and review the CODE_OF_CONDUCT.

License

See LICENSE