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

letsrequire

v2.2.2

Published

Hot require your dependencies without restarting the server

Readme

letsrequire

Overrides require() and adds hot-reload functionality

Just add require('letsrequire') and run your application with simple "node filename.js" and it will hot-load your dependencies. So, you are not required to do any change in your existing application.

Only to be used for development purposes

Install

npm install letsrequire

Usage

require('letsrequire');

API

Nothing as such, just add the 'require' statement and you are good to go. As the library overrides the native implementation of require, you do not need to make any other change in your project/code.

Errors - but nothing breaks..!! :)

There can be few errors as we are hot reloading the dependencies on file changes. The errors are console logged and we wait for the next file change to reload the file. But the system still works fine with the earlier version of the file. So NOTHING breaks..!! :)

How does it work

It uses the native require module to serve the core purpose. Watches for file changes on the application working directory that are required by this library and not all the files. Cleans the require cache when it detects that a re-require is required. Replaces all of your instances with the new module. Straight simple logic...

Note..!!

Does not hot-reload node-modules, as you are expected to restart your process. This should only be the scenario where you have altered your dependencies

Example :

A dependency file to return a simple string

    let anythingdynamic = function() {
        return "this string can be changed in runtime, and server will serve the updated one";
    }

    module.exports = {
        anythingdynamic
    }

A simple server, to response the string from the above file

    require('letsrequire');// <-- this is the new thing

    var http = require('http');

    // loading the dependencies just like before
    let reply = require("./reply.js");

    http.createServer(function (req, res) {
        // use the dependency as you usually do
        res.write(reply.anythingdynamic());
        res.end();
    }).listen(8080);

Related

  • invalidate-module - Removes a module and all of its dependents from the require cache
  • require-reload - require-reload facilitates hot-reloading files in node.js. Each call will re-fetch the file/module and require it.
  • hotter-require - Modifies require to enable hot-reloading of code modules.

License

Apache-2.0 © Rajdeep Deb