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

apostrophe-monitor

v2.1.0

Published

Automatically restart Apostrophe 2.x sites. Like nodemon, but faster because it is optimized for Apostrophe.

Downloads

60

Readme

A monitor to automatically restart Apostrophe when you make changes to your code. For use during site development. Like nodemon, but with much faster restarts because it understands Apostrophe.

Installation

npm install apostrophe-monitor
// Next, in your app.js file:
// * You must EXPORT the apos object.
// * You must PASS MODULE as the ROOT option.

module.exports = require('apostrophe')({
  root: module
});

Next, add a command to the scripts section of your package.json so you can run the monitor:

  "scripts": {
    "monitor": "monitor"
  },

Now you can launch your site with monitoring!

npm run monitor

Your site starts up. Now change a file like app.js or lib/modules/apostrophe-pages/index.js or even lib/modules/apostrophe-pages/views/pages/home.html.

When you save the change in your editor, your site automatically restarts.

This is the command you'll run forevermore when you're ready to start your site in development. Leave it running, it will automatically restart as you save changes to your code.

Configuration options

// In monitor-config.js in the root of your project
module.exports = {
  addIgnore: [ '/data/some-dynamic-content-here/**' ]
}

addIgnore should be an array of anymatch-compatible patterns starting with a /.

apostrophe-monitor always ignores:

  '/node_modules/**',
  '/public/modules/**',
  '/public/uploads/**',
  '/public/css/master-*',
  '/locales/**',
  '/data/temp/**'

If it doesn't work

You probably:

  • (a) forgot to export your apos object with module.exports in app.js, or
  • (b) forgot to pass module as the root option to Apostrophe, or
  • (c) didn't set main correctly in your package.json (for instance, main says index.js but your site is in app.js).

If your app restarts too much

You need to use addIgnore, see above. Send a PR if you find a common Apostrophe content folder (as opposed to code folder) that we forgot to ignore.

Why is it faster than nodemon?

This module is faster than nodemon because it doesn't restart the whole process and, crucially, it doesn't clear the entire require cache of Node.js. Just the files you change. Most of Apostrophe's startup time goes into reading so many .js files at startup.

Why is it only for Apostrophe?

With Apostrophe, we know how to create a new apos object and destroy an old one. But for other applications... who knows? That's why nodemon simply restarts the process.

Freeing your own resources when Apostrophe restarts

If you have your own listening sockets, database connections and file handles open in your custom Apostrophe modules, you should listen to the apostrophe:destroy promise event and clean up:

// in lib/modules/some-module-name/index.js
module.exports = {
  construct: function(self, options) {
  	self.conn = connectToSomeDatabaseYouLike();
  	self.on('apostrophe:destroy', 'closeConnection', function() {
  	  return self.conn.close();
	});
  }
}

Your handler may return a promise and it will resolve before this module creates the next apos object.