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 mapcat with all npm packages installed. Try it out:

var mapcat = require("mapcat")

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

mapcat v0.4.0

cat for source map files

mapcat is a simple utility that concatenates JavaScript files while also consolidating the corresponding source map files. It is useful if you use compile-to-JS languages whose compiler emits source map files. This is the case for CoffeeScript "transpiler" version 1.6 or later.

It's very easy to use:

bin/mapcat -m -j output.js

You specify the input by specifying the associated source map files - mapcat will find the actual JavaScript source files. Use -m to specify one output source map file and -j to specify one output JavaScript file. Invoke without any argument to see the (short) full help.


There is a simple example project in the example folder. Run bash to build the project. Then open index.html with Webkit Nightly or Chrome with Source Map support turned on in the Developer Tools. If you have Scripts panel enabled, refresh the page and you will see the program pause at a predefined debugger line, and you are looking at, CoffeeScript!

WebKit Source Map support shows in developer tools


You can also use the simple API. It exposes one simple function:

var cat = require('mapcat').cat;
cat(['', ''], 'output.js', '');


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