Registry / devops / js-loader

js-loader

JSON →
library0.1.1jsnpmunverified

js-loader is a concatenator, minifier, and dependency resolver for client-side JavaScript, designed for use in Node.js environments. The current version (0.1.1) is a legacy utility that resolves CommonJS-style dependency trees and bundles them for the browser. It has been unmaintained since 2011 and is deprecated in favor of modern bundlers like webpack, Rollup, or esbuild. Key features include on-the-fly dependency resolution and minification via uglify-js. This package is not suitable for modern workflows and may have security vulnerabilities in its dependencies.

npm install js-loader
INSTALL
IMPORT
SIG · JS-LOADER
J
js-loader
devopsjavascriptv0.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jsLoader
const jsLoader = require('js-loader');
import jsLoader from 'js-loader';
The package is CommonJS-only and does not support ESM imports.
resolveDependencies
const { resolveDependencies } = require('js-loader');
import { resolveDependencies } from 'js-loader';
The package does not export named symbols; you must destructure from the default export.

Demonstrates loading a JavaScript entry point and bundling its dependencies into a single minified string.

const jsLoader = require('js-loader'); const path = require('path'); const entry = path.join(__dirname, 'lib', 'main.js'); jsLoader.load(entry, function(err, bundle) { if (err) throw err; console.log(bundle); // bundled and minified JavaScript });
Debug
Known issues
deprecatedPackage is no longer maintained. Do not use for new projects.
fix
Use webpack, Rollup, esbuild, or another modern bundler.
affects: >=0.0.0
gotchaThe 'load' function expects a callback. It does not support Promises or async/await.
fix
Wrap the call in a Promise if you need async/await.
affects: >=0.0.0
gotchaThe package may use older uglify-js versions with known security vulnerabilities.
fix
Do not use this package; it relies on outdated dependencies.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'js-loader'
Package not installed or not in node_modules.
fix
Run 'npm install js-loader' or check your package.json.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
uglify-jsrequiredUsed for minification of concatenated JavaScript.
Agent activity
4 hits · last 30 days
node
4
Resources
js-loader — npm install js-loader · libregistry