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-config

v2.0.1

Published

Module for loading mako config from a file.

Readme

mako-config

A helper for loading mako build config from a file.

npm version npm dependencies npm dev dependencies

This helper is for loading mako build configuration, allowing easy use among different tools.

Usage

var load = require('mako-config')

// async
load().then(function (config) {
  // config.entries
  // config.plugins
})

// sync
let config = load.sync()
// config.entries
// config.plugins

Configuration File Structure

If you are using a standalone file, (eg: .makorc) the structure below will be the entire JSON object contained. If you are using a package.json, the JSON will be contained by a property. (the default is mako)

root

If specified, this allows you to set a custom root/base path for entries.

NOTE: paths are still resolved relative to the config file location, but when these files are added to the mako tree, their base path will be this custom value.

entries

This will be an array of glob patterns that will be resolved to form a single list of entry files. The patterns will all be resolved relative to the config file's location.

{
  "entries": [
    "index.{js,css}",
    "pages/**/index.{js,css}",
    "public/**"
  ]
}

plugins

This will be an array of plugins to load, they can either be installed modules or point to local modules of your own:

{
  "plugins": [
    "mako-browser",
    "./local-plugin.js"
  ]
}

By default, no arguments will be passed during initialization. To change this, use an array:

{
  "plugins": [
    [ "mako-browser", { "output": "dist" } ]
  ]
}

concurrency

If you want to set the concurrency level, you can use this property as a number.

env

When you want to load plugins or entries only in a specific NODE_ENV, you can create an object here for each of those environments. (the default env is "development")

In this example, we add JS and CSS minification (via uglify and cleancss respectively) when we run with NODE_ENV=production:

{
  "env": {
    "production": {
      "plugins": [
        "mako-uglify",
        "mako-cleancss"
      ]
    }
  }
}

The structure underneath each env is identical to the root level, and both entries and plugins will be appended to those defined at the root.

API

load([options])

This function loads mako config starting for a project.

It starts in the dir and searches up for a standalone file first, such as a .makorc. If one is found, that is taken immediately. (there is no cascade)

If this yields no config, it will then search for the nearest package.json in a similar fashion, looking for one with the mako property.

If no valid configuration is found, the promise will be rejected.

Available options:

  • dir the starting directory (default: pwd)
  • filename the config filename to search for (default: .makorc)
  • property the package.json property to use (default: mako)
  • overrides user-supplied overrides for the entries

It returns a promise that resolves with an object. It will contain the following keys:

  • root: the absolute path to an alternate root (null if not specified)
  • entries: an array of absolute file paths to all the matched entry files
  • plugins: an array of the initialized plugin functions
  • concurrency: a number for concurrency if included in the config file
  • path: the absolute path to the file that was loaded (aka: file)
  • env: the known environment used for this config (eg: "development")
  • original: a copy of the original JSON structure

load.sync([options])

The same arguments are accepted, and the same result is returned synchronously. (any errors will be thrown as an exception)