Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

modulr

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modulr

Resolves and concatenates CommonJS module dependencies for use in the browser.

  • 0.4.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

modulr

Resolves and concatenates CommonJS module dependencies for use in the browser. It's a port of modulr from Ruby to node.js and is based on module-grapher, a node module which resolves dependencies through recursive static analysis.

Install

modulr is available as an NPM module.

$ npm install modulr

Usage

modulr accepts the main module's identifier and an optional config object as arguments which get passed to module-grapher. It outputs a small runtime and the concatenated modules sources as a string.

require('modulr').build('foo', {
  paths: ['./lib', './vendor'], // defaults to the equivalent of ['.']
  root: 'path/to/package/root/' // defaults to process.cwd()
}, callback);

modulr can also accepts a CommonJS package or its package.json file as argument. I which case it uses the JSON file's main value as entry point, the package's dir as root, and picks the rest of its options from the JSON file's modulr namespace.

require('modulr').buildFromPackage('path/to/package', callback);

License

Your choice of MIT or Apache, Version 2.0 licenses. modulr is copyright 2010 Tobie Langel.

FAQs

Package last updated on 22 Sep 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc