Skip to content
Browse files

Add working hardcode example

  • Loading branch information...
1 parent 362a683 commit 2183e63efda3765279933a786c9d5fdf1d3091c2 @StephanHoyer committed
Showing with 30 additions and 0 deletions.
  1. +16 −0 example/chukfile.js
  2. +1 −0 index.js
  3. +13 −0 lib/index.js
View
16 example/chukfile.js
@@ -0,0 +1,16 @@
+module.exports = {
+ 'foo': function(scope) {
+ scope.foo = 1;
+ console.log('foo');
+ },
+
+ 'bar': function(scope) {
+ scope.bar = 1;
+ console.log('bar');
+ },
+
+ 'default': function(scope) {
+ scope.default = 1;
+ console.log('default');
+ }
+};
View
1 index.js
@@ -0,0 +1 @@
+module.exports = require('./lib');
View
13 lib/index.js
@@ -0,0 +1,13 @@
+var repl = require('repl');
+
+var env = 'foo';
+
+chukRepl = repl.start({
+ prompt: "chuk > ",
+ input: process.stdin,
+ output: process.stdout
+}).on('exit', function() {
+ console.log('Exit');
+})
+
+chukRepl.bufferedCommand = "require('./example/chukfile.js')." + env + "(global);";

0 comments on commit 2183e63

Please sign in to comment.
Something went wrong with that request. Please try again.