Created
May 16, 2019 17:44
-
-
Save Wicker25/4057276fa5b3d6fd586b1bb6fbddfe79 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 repl = require('repl'); | |
function myEval(cmd, context, filename, callback) { | |
callback(null, String(cmd)); | |
} | |
const replServer = repl.start({ | |
prompt: '~> ', | |
//eval: myEval | |
}); | |
class TargetCollection extends Array { | |
filter() { | |
return new TargetCollection(...this); | |
} | |
} | |
class Paguro { | |
constructor() { | |
this.targets = new TargetCollection(); | |
this.targets.push(1); | |
this.targets.push(2); | |
this.targets.push(3); | |
} | |
toString() { | |
return '<Paguro>' | |
} | |
} | |
const paguro = new Paguro(); | |
replServer.context.paguro = paguro; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment