Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including js-cat with all npm packages installed. Try it out:

var jsCat = require("js-cat")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

js-cat v0.10.0

Concatenate Javascript Files With SourceMaps

####Concatenate Javascript Files With Sourcemaps

Installation

npm install js-cat

Usage


jsCat = require('js-cat');

//From Code

var files = [
    {code : '<Javascript Source Code>', map: '<optional><old sourcemap>', path: '<Path of File>'},
    {code : '<Javascript Source Code>', map: '<optional><old sourcemap>', path: '<Path of File>'}
]

jsCat.concatSource(files, { mapFilePath : 'output.min.map' }, function(err, data) {
    
    if(err) return console.log(err);
    
    console.log(data.code, data.map);

})

//From Files List

jsCat.concatFiles(['test1.js', 'test2.js'], { mapFilePath : 'output.min.map' }, function(err, data) {
    
    if(err) return console.log(err);
    
    console.log(data.code, data.map);

})

License

MIT

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free