
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
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.
modulr
is available as an NPM module.
$ npm install modulr
modulr
accepts the main module's identifier and an optional config object as arguments which get passed to module-grapher
. It returns a result object whose output
property is a string containing a small runtime and the concatenated modules sources. Optionally, this output can be minified and the module identifiers resolved server-side.
require('modulr').build('foo', {
paths: ['./lib', './vendor'], // defaults to ['.']
root: 'path/to/package/root/' // defaults to process.cwd()
minify: true, // defaults to false
resolveIdentifiers: true, // defaults to false
environment: 'prod' // or 'dev', defaults to undefined
}, callback);
// Dump the output to `main.js`.
function callback (err, result) {
if (err) { throw err; }
require('fs').writeFileSync('/path/to/main.js', result.output, 'utf8');
}
modulr
can also accepts a CommonJS package or its package.json
file as argument. In 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);
Your choice of MIT or Apache, Version 2.0 licenses. modulr
is copyright 2010 Tobie Langel.
FAQs
Resolves and concatenates CommonJS module dependencies for use in the browser.
The npm package modulr receives a total of 3 weekly downloads. As such, modulr popularity was classified as not popular.
We found that modulr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.