Created
August 6, 2015 08:57
-
-
Save artpi/0a5462a679520292565c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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