
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
concatenate-js
Advanced tools
Implements a technique to bundle large numbers of JS files into a single file while maintaining the original file boundaries and names inside development tools. Use this to make your JavaScript serving system be awesome during development without the complexity of source maps.
The module rovides a single function to concatenate a list of JavaScript files into a single output stream in a way that, when executed in the browser, maintains the illusion in JS development tools, that the files had been loaded as individual script tags.
Demo: http://jsbin.com/isozid/1/quiet
var js = require('./concatenate')([
{
content: 'function foo() {alert("foo")}',
filename: 'js/foo.js'
},
{
content: 'function bar() {alert("bar")}',
filename: 'js/bar.js',
hostname: 'app2'
}
]);
Specifying the hostname is optional, the default is 'app'. Chrome Dev Tools groups JS files under the hostname.
This is using multiple eval calls with @sourceURL annotations in a single output stream.
This is better than source maps under these circumstances:
Why is it better:
When you have a syntax error at least V8 based browsers will not show you a line number.
(For the generated JS)
The exported function supports a second param which is a function that gets to modify the output after the eval was added. You may find this useful for i.e. adding CommonJS module wrappers. For an example see example_common_js_simulator.js.
FAQs
Concatenate JavaScript with awesome debuggability.
The npm package concatenate-js receives a total of 1 weekly downloads. As such, concatenate-js popularity was classified as not popular.
We found that concatenate-js 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.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.