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

questmap

v0.1.0

Published

exercise helper for webquest

Downloads

2

Readme

questmap

questmap is a simple helper library for writing webquest exercises.

Installation

npm install questmap

Usage

First, initialize an exercise and export it at the end:

const qm = require('questmap')

const exercise = qm()

module.exports = exercise

Then, you can add processors and such:

const qm = require('questmap')

const exercise = qm()

exercise.addVerifySetup(async function () {
  // setup here
})

exercise.addProcessor(async function () {
  // processing here
})

exercise.addRunCleanup(async function () {
  // cleanup here
})

module.exports = exercise

Exercise flow

There's three different stages which we can modify: setup, processor and cleanup. Although it's not required, it's recommended to use them in this way:

  • setup for setting up variables, objects and other things
  • processor to actually check and run exercises
  • cleanup to close connections, clean up variables and such

There's also three different versions of each, one that only runs when the exercise is in Verify mode, one for if it's in Run mode, or one that runs on both:

exercise.addProcessor()
exercise.addRunProcessor()
exercise.addVerifyProcessor()

NOTE: The function arguments to these functions HAVE to be async function (), NOT arrow functions.

Interacting with the exercise

The most important part of exercise verification and running is this. this keeps functions that let us interact with what the user sees, but also contains important contextual variables. Here's a list of what it contains:

this.log(MESSAGE)

Outputs an info message to the user.

this.error(MESSAGE)

Fails the exercise with MESSAGE.

this.end()

Ends the exercise run. If this.error() hasn't been called previously, passes the exercise. This doesn't need to be run, only if you want to end the exercise run early.

this.mode

Contains the mode, e.g. run or verify.

this.bus

Contains the nanobus instance used to talk to the user. It's not recommended to use this directly.

this.file

The path to the solution file passed in by the user.

this.context

The this object used by webquest itself.

Maintainers

This project is a community-owned and maintained project, meaning everyone takes part in caring for its wellbeing. Its current contributors are:

  • @pup (Olivia Hugger)

License

AGPL-3.0+ (see LICENSE)