node package manager


Preprocessor Directives for JavaScript


Tum-Tum is a highly lightweight JavaScript preprocessor, with the simple purpose of allowing you to include javascript files in your javascript files. It has no problems with including files that also include files, and can include non-JavaScript files. Technically speaking, it'll work with any kind of files you give it, not just JavaScript. Here's how you use it.

Simple example:

var tum = require('tum-tum');

tum.processFile( "not-processed.js", "processed.js" ); //or with a callback function tum.processFile( "not-processed.js", "processed.js", function( result ) { //do stuff.. }); //or with options var options = { "mode": "echo" }; //currently the only option is mode, whose values are "echo", or "write" //echo simply invokes the callback, with the processed contents of the file as the argument //write processes the file indicated in the first argument, and writes it to the file indicated in the second argument, and invokes the callback if it's declared tum.processFile( "not-processed.js", "processed.js", options, function( result ) {