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

nodejs4xpcom

v0.0.2

Published

An XPCOM plugin (for Firefox, Thunderbird, etc) that provides an AMD-compatible Node.JS module loader

Downloads

5

Readme

nodejs4xpcom (n4x)

nodejs4xpcom (or n4x) is an XPCOM plugin (for Firefox, Thunderbird, etc) that provides an AMD-compatible Node.JS module loader.

Usage

First, this plugin must be installed in the XPCOM application (Firefox, Thunderbird, etc). Then, the following code snippet will allow you to require or define dependencies to Node.JS modules that have been installed into the standard npm node_modules directory.

For example, the following makes use of the underscore module:

Components.utils.import("resource://n4x/modules/nodejs.jsm");
let require = nodejs.make_require(__LOCATION__);
let _ = require('underscore');
let squares = _.map([3, 6, 12], function(i){ return i*i; }));
// result: squares == [9, 36, 144]

Limitations

n4x loads Node.JS modules as if they were standard JavaScript scripts. Many modules, however, make use of other modules that are provided by the Node.JS environment, such as fs and util, and therefore cannot be loaded by XPCOM. In order to provide that functionality, an adapter for each of those system modules must be created. Here is a summary of that effort for each of the system modules for Node.JS version 0.8.17:

Module | Support | Module | Support | Module | Support | Module | Support ------------- | ------- | ------- | ------- | -------------- | ------- | ------ | ------- assert | 20% | fs | 0% | process | 0% | tls | 0% buffer | 0% | globals | 10% | punycode | 0% | tty | 0% child_process | 0% | http | 0% | querystring | 0% | dgram | 0% cluster | 0% | https | 0% | readline | 0% | url | 0% crypto | 0% | modules | 0% | repl | 0% | util | 0% dns | 0% | net | 0% | stdio | 10% | vm | 0% domain | 0% | os | 0% | stream | 0% | zlib | 0% events | 0% | path | 0% | string_decoder | 0% | |

These adapter packages will be implemented on an as-needed by the maintainers basis; if you need one before we do, you are encouraged to implement it and issue a pull-request: these will be accepted quickly.