-
-
Save dgmike/381478f5fb60da684f96 to your computer and use it in GitHub Desktop.
Autoloading files in node shell
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
/*jslint indent: 2, node: true*/ | |
"use strict"; | |
exports.hello = function() { | |
console.log("Hello World!"); | |
}; | |
console.log("preamble executed! poor guy!"); | |
/* vim: set ts=2 sw=2 tw=0 et :*/ |
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
#!/bin/bash | |
# require("./__preamble__.js"); | |
# repl = require("repl").start("> "); | |
# console.log("loaded..."); | |
node -e 'require("./__preamble__.js"); repl = require("repl").start("> "); console.log("loaded...");' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just run this using ./my_node.sh - You can use an alias too.