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

grequire

v1.0.0

Published

Synchronous require of multiple modules that match a given glob pattern

Downloads

4

Readme

This module provides a way to synchronously load multiple Node.js modules using glob pattern matching.

Example

Require all sibling modules (relative to this module):

var results = grequire(module, "./*.js")

console.log(results)

Output:

[{
  filename: './sibling-1.js',
  exports: { /* exports of sibling-1 */ }
}, {
  filename: './sibling-2.js',
  exports: { /* exports of sibling-2 */ }
}]

Also see the spec, it shows many different combinations of parameters, with comments.

API

grequire([module, ] pattern [, globOpts])

  • module The module object that requires should be performed on behalf of. Usually this should be the free module variable, like in the example above.

  • pattern, globOpts The glob pattern and options to use when matching files. See the node-glob documentation.

Returns an array of items, where each item corresponds to one required module, and has the following contents:

{
  /**
   * The filename of the loaded module. It may be absolute or relative,
   * depending on the pattern. See test/index.js for examples.
   */
  filename: String,
  /**
   * The loaded module's exports.
   */
  exports: AnyObject
}

ES6

This module is written in ES6, and ES5 code is generated using Babel.

If you live in the future or use Babel (or some other transpiler), you may want to load the non-transpiled ES6 code:

import grequire from 'grequire/es6'

License

MIT