Skip to content

Instantly share code, notes, and snippets.

@artpi
Created August 6, 2015 08:57
Show Gist options
  • Save artpi/0a5462a679520292565c to your computer and use it in GitHub Desktop.
Save artpi/0a5462a679520292565c to your computer and use it in GitHub Desktop.
var filendir = require('filendir');
function define(fileName, args, func) {
var content = '';
if (typeof func === 'function') {
content = "define('" + fileName + "', \n" + JSON.stringify(args).replace(/,/g, ",\n") + ", \n" + func.toString() + "\n);";
} else if (typeof args === 'function') {
content = "define('" + fileName + "',\n" + args.toString() + "\n);";
}
filendir.ws(fileName + ".js", content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment