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 🙏

© 2024 – Pkg Stats / Ryan Hefner

bpack-debug

v1.0.0

Published

Browserify helper to save the export value of a module for easier debugging

Downloads

6

Readme

bpack-debug

A browserify helper to save the export value of a module for easier debugging.

It doesn't require changing your build - it works at runtime by simply requiring bpack-debug and running it. It scans the raw source of modules in the module cache for the alias name to export as a docblock directive.

Build Status

example

// in main.js
require('bpack-debug')(window);
/**
 * This is my my-module.js
 * @debugKey app.myModule
 */
module.exports = function(name) {
  console.log('hello ' + name);
}
// in the console
app.myModule('andres');
// hello andres

usage

bpackRequire(targetObj[, debugKey])

  • targetObj is the object to which you want to save the exported modules.
  • debugKey (optional) the docblock directive for the alias of the module. It can contain periods to denote a deep object.

targetObj.bpackDebug(alias)

bpack-debug lazily loads modules so it doesn't disturb the natural order of your dependency loading. However, if you need to access a module that hasn't been loaded yet, it can be forcefully loaded with this function.

caveats

  • bpack-debug is meant for development use only. The comment directives must exist for it to work. So if you minify the bundle, and remove the comments, it naturally won't work.
  • bpack-debug doesn't work across split bundles. Each bundle must load bpack-debug on its own.