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 🙏

© 2026 – Pkg Stats / Ryan Hefner

wassup-doc

v1.0.0

Published

A small, stupid module for documenting your code.

Downloads

5

Readme

wassup-doc

wassup-doc is a module for documenting your programs via method chaining -- no need for a gadget that reads your comments.

(insert obligatory bugs bunny image here)

Examples

Documenting a function:

const doc = require('wassup-doc') // *munches carrot*
/*
  `doc` is a wrapper for whatever you're about to document -- mutating
  `Function.prototype` would be bad.
*/
const abs = doc(Math.abs.bind(null))
  // surprisingly, `Math.abs.name` is 'abs', not 'Math.abs'
  .name('Math.abs')
  // provide a short summary
  .summarize('Returns the absolute value of an argument.')
  /*
    `doc.prototype.desc` can be used to provide a long summary if you need
    one, otherwise the description will be identical to the summary.

    You can also derive a summary from the description; In this case the
    summary will be the first sentence of the description.
  */
  // a short annotation explaining what the function takes in and spits out:
  .annotate('(Number) -> Number')
  // and finally we need to unwrap the value:
  .value()
// the `help` function is case insensitive
console.log(doc.help('math.abs'))

help formats the output using chalk, so you'll get nice(-ish) output like this:

Math.abs (Number) -> Number

=======================

Returns the absolute value of an argument.

There's also a nice function for making sure the outputs from your higher-order functions get reasonable names:

const {higherOrder, rename} = require('wassup-doc')
/*
  We need to provide an explicit name because JavaScript has trouble deriving
  names from higher-order functions...

  ...but luckily we have an optional second argument for that.
*/
const flip = higherOrder(
  f => (x, y) => f(y, x)
  ,'flip'
)
const append = (x, y) => x + y
// what would you call it? :>
const flappend = flip(append)
console.log(flappend.name)
// ^ 'flip(append)' -- it would have been '' if it weren't for `higherOrder`
console.log(flappend('trains', 'i like ')) // 'i like trains'

// a hopelessly overspecialized curry function
const curry3 = higherOrder(
  f => (...xs) => xs.length === 3
    ? f(...xs)
    : xs.length === 2
    ? y => f(...xs, y)
    : (...ys) => ys.length === 2 ? f(...xs, ...ys) : z => f(...xs, ...ys, z)
  ,'curry3'
)

const tern = rename(curry3((cond, x, y) => cond ? x() : y()), 'curry3')
const always = tern(true)
// ^ also known as `const` (hello haskellers ^^)
console.log(always.name) // 'tern(true)'
const foo = tern(true, function () {
  console.log('Laziness is nice but I\'m going off-topic so this example is getting hopelessly long.')
  return 'You shouldn\'t put side effects in some places.'
})
console.log(foo.name) // 'tern(true,anonymous)'

Features

  • 4/10 quality
  • Simple
  • Hasn't been voted "crummiest module ever" (so far)
  • Dynamic (as in stuff gets documented at runtime)

Installation

Just type

`npm install project`

and enjoy knowing what your functions do!

Contribute

License

The project is licensed under the MIT license.