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

mako-serve

v3.0.2

Published

A CLI tool for serving up files built using mako.

Readme

mako-serve

A server for automatically building and serving files built via mako.

npm version npm dependencies npm dev dependencies

Install

This can be installed via npm:

sudo npm install -g mako-serve

This will install it globally, but using it locally is likely more flexible. Either way, you get access to a mako-serve command that you can run.

How it works

On startup, the server runs an initial build. Once it is ready, it sets up a watch for the root, and rebuilds whenever changes occur. The server itself simply serves up the output directory as static files.

Therefore, this particular tool adds the assumption of an output directory, which isn't managed by mako directly. The output config will be the same as a tool like mako-output. (and will be relative to the root)

CLI


  Usage: mako-serve [options] [...entries]

  Options:

    -h, --help            output usage information
    -V, --version         output the version number
    -b, --base <url>      set a custom base url
    -C, --cache           turn on caching
    -c, --config <path>   use a custom config path
    -f, --favicon <path>  set the path to a favicon image
    -l, --livereload      turn on livereload
    -o, --output <path>   the output path for serving files from
    -p, --port <number>   set the server port number

Like mako-cli, this tool accepts configuration from a file, instead of using flags for everything. The default config file is mako.json, but you can specify your own via --config <path>. (the way this config file is interpreted is identical to mako-cli)

If you specify any entries, it will use those in place of those specified in the mako.json, allowing you to do only a subset of the overall build.

If you turn on caching via --cache, it will load and save to the cache before and while running. (the location is the same as mako-cli, which is ./mako.cache)

livereload

Currently, only the CLI supports livereload by adding the --livereload flag. This capability will eventually be extended to the JS API as well.

When enabled, a livereload server will be started. The easiest way to develop with this is to add an official browser extension, as it will automatically detect the livereload server and start accepting commands.

To use this feature without a browser extension, you can add the following code to your HTML:

<script>
document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] +
 ':35729/livereload.js?snipver=1"></' + 'script>')
</script>

This isn't ideal though, as you need to remember to remove this snippet if you want to copy your output files into production. To avoid this, you could also add the JS itself to your own application, but wrapped in a conditional to check for development/local. (so it doesn't run at all in production)

API

The core functionality is a koa middleware, which allows you to use the JS API to add this to your own server. (see bin/mako-serve for an example that you might adapt for yourself)

serve(options)

Creates the core functionality that you can use in your own koa app.

Available options:

  • root sets the builder root
  • output path relative to root from which to serve files
  • entries a list of entry files (at least 1 is required)
  • plugins a list of plugins (already initialized)
  • cache pass the location of a file in order to load and save a cache
  • livereload use to enable livereload via the watcher

The returned object includes the following properties:

  • middleware a generator function that has the core middleware
  • watcher the watcher instance that was created and is running
  • livereload if enabled, the livereload server instance