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

mimosa-server-reload

v1.1.0

Published

A Mimosa module for restarting node http servers being used with Mimosa's watch command.

Readme

mimosa-server-reload

Overview

This is a Mimosa module for restarting a node server when server-bound assets (like routes, general lib files) change.

For more information regarding Mimosa, see http://mimosajs.com

Note: Version 0.7.0 requires mimosa 0.13.3 or above.

Usage

Install 'mimosa-server-reload' using the mimosa mod:install mimosa-server-reload command. The mimosa-server module is a prereq.

Functionality

The mimosa-server-reload module will point itself at a list of configurable files/folders and when the contents (recursive) of those change, it will work with both the mimosa-server and mimosa-live-reload modules to restart the user's server.

If you are using mimosa-server-reload, as part of restarting your server, this module shuts down the web socket connections that enable live reload so that the server can be closed. It restarts the server-side of the web socket connection, but does not reconnect with the client. So after the server is restarted, you need to refresh the browser to reconnect live reload.

Some prerequisites for this module are:

  • Must be installed inside Mimosa, where mimosa-server is located
  • You must be using mimosa-server
  • You must start Mimosa using the --server or -s flag
  • You must not being using Mimosa's hosted server. Your server.defaultServer.enabled value should be set to false.

mimosa-live-reload is not a prereq, but this module will work with that one if it is present to shut down socket connections.

Pre-restart Hook

As of version 2.2.14 of Mimosa and 0.9.0 of this module, if your server file (same location as startServer function) has a preMimosaRestart function that has been exported, mimosa-server-restart will call it before it restarts your server. This gives you an opportunity to clean up any resources like connections to databases, etc.

preMimosaRestart will be passed a callback. When everything that needs cleaning up is finished, execute the callback. This module will then execute the restart.

exports.preMimosaRestart = function (callback) {
  // Clean stuff up here
  callback();
}

Default Config

serverReload:
  watch:["server.coffee", "server.js", "server.ls", "server.iced", "routes", "src", "lib"]
  exclude:[]
  validate:true
  • watch: an array of strings, folders and files whose contents will trigger a server restart when changed. By default all the possible server names generated by mimosa new are included as well as the routes folder, which is also delivered by mimosa new. Also considered defaults are typical source colde libraries: src and lib. Paths can be relative to the root of your project or absolute.
  • exclude: an array of strings and/or regexs, the list of files and file patterns to exclude from restarting the server. Can be a mix of regexes and strings. ex: ex: [/\.txt$/, "vendor/jqueryui.js"]. Can be left off or made null if not needed. Can be relative to the root of your project or absolute.
  • validate: a boolean, whether or not to validate changed files. When true, the default, mimosa-server-reload will require() the changed file. If the require fails, because it is invalid CoffeeScript/JavaScript for instance, Mimosa will not attempt to restart the server since the restart will likely fail. validate: true will cause problems if you point watch at non JavaScript files, for instance, server views. If you include your views folder in watch, you will want to turn validate off.