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

challenger-code

v0.3.0

Published

Challenger code.

Downloads

9

Readme

Challenger Code

Challenge yourself with coding exercises. Official website: challengerco.de.

Installation

If you want to install locally:

$ npm i challenger-code

Start with

$ npm start

You will need a running instance of MongoDB listening to 127.0.0.1, no security. It will use database cc.

Configuration

You will need to have a file in the root directory called .challenger-code.json, containing:

{
	"jwtSecret": "...",
    "githubId": "...",
    "githubSecret": "..."
}

The first value jwtSecret is used to encrypt JWT tokens, so make sure that it is kept secret. The next values githubId and githubSecret are used to authenticate using GitHub. Please refer to GitHub: Authorizing OAuth Apps for details.

API

The following API calls are published.

GET /api/challenge/:owner/list

Returns a list of challenges with id and name from owner.

GET /api/challenge/:owner/:id

Returns the challenge with the given owner and id.

POST /api/challenge/:owner/:id/run

Runs the given challenge id from owner with some code. Body parameters:

  • code: the code to run.

Pending Stuff

This is a list of things I'm working on. Please let me know if you want to tackle any so we don't duplicate efforts. Thanks!

  • Challenge editor: accepts submissions from anyone, saved as challengeco.de/owner/challenges.
  • Admin role: select challenges for the main collection.
  • Challenger list: select by category, difficulty.
  • User page: show challenges run and achievements by any player.
  • ✅View challenge stats: show min and average for: nodes, execution time, memory?
  • Check max memory used by a challenge run.
  • Browser runner: run challenges directly in the browser.
  • ✅Redirect http site to https.

Architecture

The project uses fastify. It loosely follows the structure of fastify-example-twitter.

Compatibility

Version 0.2.0 to 0.3.0

Challenge runs now have id, not challengeId. If you want to preserve your existing challenge runs, use this script on the mongo console:

> db.runs.find().snapshot().forEach(e => db.runs.update({_id: e._id}, {$set: {id: e.challengeId}})

Acknowledgements

The code and challenges are open for participation. Pull requests are very welcome!

(C) 2020 Alex Fernández. Licensed under the GPL v3. See LICENSE file for details.