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 🙏

© 2025 – Pkg Stats / Ryan Hefner

dev-refresh

v1.2.1

Published

`dev-refresh` is a utility to watch for changes in directories, and then run your bundler or transpiler or what have you, before refreshing your browser. If the bundler/transpiler fails, the error message will be displayed in the web page, and the page wi

Downloads

30

Readme

dev-refresh

dev-refresh is a utility to watch for changes in directories, and then run your bundler or transpiler or what have you, before refreshing your browser. If the bundler/transpiler fails, the error message will be displayed in the web page, and the page will not be reloaded.

It supports both serving your local files (if you only need basic web server functionality), and proxy requests to a web server if there's a server component to your web application.

This program is not meant for production use; please only use it while developing.

Install

npm install --save-dev dev-refresh

Usage

Run ./node_modules/.bin/dev-refresh -h for a list of arguments.

It will output this:

Usage: dev-refresh [options] watch...
Options:
-h, --help          Show this help text and exit
-c, --cmd <cmd>     Run <cmd> on change
-s, --serve <dir>   Serve files in <dir>
-p, --proxy <host>  Proxy requests to <host>
--port <port>       Serve on port <port>.
--host <host>       Serve from host <host>.
-n  --no-open       Don't open the page in a browser.

Basic server

I recommend not running dev-refresh directly, but adding an npm script. For example, to just serve the files in public/ and automatically reload when they change, put this in package.json:

"scripts": {
	"watch": "dev-refresh public --serve public"
}

Now, running npm run watch will create a server on 127.0.0.1:8080 which serves the content of public/, and any time a file in the directory changes, the browser will automatically reload.

Transpiling

Let's say you're using babel with browserify to transpile modern javascript to ES5. Let's say you want npm run build-dev to compile once, and npm run watch to recompile and serve with dev-refresh. Put this in package.json:

"scripts": {
	"watch": "dev-refresh --serve public --cmd 'npm run build-dev' js"
	"build-dev": "browserify js/main.js -t [ babelify --sourceMap ] --debug --outfile public/bundle.js",
}

Now, npm run watch will automatically transpile and reload the browser whenever anything in js changes.

Proxy

If you have an application with a server side component, you might not want dev-server to serve any static files, but might still want automatic transpilation or reloading.

To start dev-refresh on port 8081, with a proxy to localhost:8080, and running npm run build-dev any time anything in js or sass changes, run:

dev-refresh --port 8081 --proxy 'localhost:8080' --cmd 'npm run build-dev' js sass