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

noder-js

v1.6.2

Published

JavaScript CommonJS loader

Downloads

34

Readme

Noder

Build Status Dependencies devDependencies

npm

Features

Noder is a JavaScript loader for web browsers with the following features:

  • It is compatible with CommonJS Modules/1.0 specifications and mostly compatible with the node.js module system. This allows to easily import dependencies with var myModule = require("myModule");

  • It is (and will stay) small: < 6kB minified and gzipped.

  • It supports both packaged and unpackaged modules.

  • It supports both asynchronous and synchronous HTTP requests (requests are asynchronous by default to avoid blocking the browser).

  • Modules can be loaded on demand (both in packaged and unpackaged mode).

  • It is tested on:

    • Firefox (latest)
    • Chrome 30
    • Safari 6
    • Internet Explorer 7, 8, 9, 10 and 11
    • Android 4.0
    • PhantomJS
  • It is very likely to be compatible with other browsers as well.

  • Even if it is intended to be run on web browsers, a node.js version of Noder is also available.

  • It has many configuration options (check the documentation).

Why using Noder ?

As node.js is increasingly being used to implement web servers and command line tools, it is important to be able to reuse some libraries both in a browser and in node.js.

To achieve this goal, there are several approaches:

  • Some projects, such as Browserify or Webmake, provide a tool to package in a single file a set of node.js modules which can then be used from the browser. This is convenient for small applications, but for bigger ones, having a loader, instead of only a packager, allows to improve the user experience by loading at the beginning only what is strictly needed (thus reducing the time to display the first page) and then loading later additional modules when they are required. A packager is still useful, though, to group files together instead of doing a different request for each module.

  • Other projects, such as Requirejs or Curl, provide loaders compatible with the Asynchronous Module Definition API (AMD), but, as a consequence, they are not directly compatible with the node.js module system. Then, for a library written as a set of AMD modules to run on node.js, it must be loaded through a specific loader (such as r.js) running on top of the node.js module system, which makes it more difficult to use in a usual node.js application. Some people suggested to add AMD support to node.js, but it was refused as it increases too much the complexity of the loader.

  • The approach used by Noder is to provide a loader for browsers to be able to run unmodified node.js modules. The fact that Noder is compatible with the synchronous (and simple to use) require syntax does not mean it is using synchronous requests though (even if a synchronous mode is also supported). By default, all requests are done asynchronously through XHR but Noder waits until all transitive static dependencies of a module are loaded before executing the code of the module.

    • When a non-packaged module is requested, dependencies are determined by quickly parsing the content of the module with regular expressions, extracting all calls to the require function. Note that non-packaged mode is normally used only during development.
    • When a packaged module is requested, the package format (very similar to the one used by Requirejs) contains for each module the pre-computed set of dependencies, so that there is no need at run-time to parse the module content to extract calls to the require function.

Getting started

  • Download the noder-browser.zip file from the latest release of Noder in the releases section.

  • Extract it in the folder of your choice. It contains the following files and directories:

    • noder.min.js: main entry point of Noder
    • noder.js: unminified version of noder.min.js, can be used instead of noder.min.js for debugging.
    • noderError: this directory contains files which are automatically downloaded when an error occurs, so that more details can be displayed about it.
  • Add the following line in your HTML page, replacing firstModule with the name of the first module to load and execute:

<script type="text/javascript" src="noder.min.js?firstModule"></script>

By default, the module is looked for in the same directory as the HTML page, but it is possible to change it through configuration options. When the page is loaded, firstModule.js will automatically be loaded and executed.