Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Mar 04 19:33
    HolySuicidalTurkey commented #127
  • Feb 15 18:14
    jeremygiberson-at-privoro commented #292
  • Feb 15 18:12
    jeremygiberson-at-privoro commented #292
  • Feb 15 18:12
    jeremygiberson-at-privoro commented #292
  • Feb 15 18:11
    jeremygiberson-at-privoro commented #292
  • Feb 03 21:27
    reiser commented #343
  • Dec 04 2020 20:04
    DominicChm commented #352
  • Nov 28 2020 15:23
    HugoPoi commented #331
  • Nov 02 2020 01:32
    paul-qamaestro commented #42
  • Nov 02 2020 01:31
    paul-qamaestro commented #42
  • Nov 02 2020 01:31
    paul-qamaestro commented #42
  • Nov 02 2020 00:29
    paul-qamaestro commented #42
  • Oct 30 2020 00:33
    slinkardbrandon commented #332
  • Oct 29 2020 15:37
    macrozone commented #332
  • Oct 29 2020 15:35
    macrozone opened #352
  • Oct 29 2020 14:48
    sweethuman commented #332
  • Oct 29 2020 14:45
    macrozone commented #332
  • Oct 20 2020 15:01
    drodenberg commented #331
  • Oct 07 2020 10:45
    Michelle99798 closed #351
  • Oct 07 2020 02:34
    Michelle99798 opened #351
Brandon Slinkard
To draw attention to the above I also implemented coveralls with that PR.
is possible with Vorpal command
connect to WS socket
and display "messages" in screen
but the command line available ?
is impossible "detach" the command... anyone can help me?
Jason Schwarzenberger
how to prevent the process.exit() from happening on .parse()?
also, how can i capture the output to a string rather than the console?
(context: i am trying to use this to build a command line for a telegram bot.)
Jason Schwarzenberger
i think i'm ok now.
Hello all, just a question. is it possible to run vorpal command that execute a background process/service, exiting from application/vorpal, connecting later again in a second and attach to the previous "process"?
I.e.: Running some vorpal commands (than running one or more background processes), exit from shell/ssh, connecting again running again the application and "reconnecting" so I can "resume" the UI and interact with the previous started processes? I hope I was clear. Thanks!
You would likely want to use IPC/sockets to connect/re-connect with some long running process you have spawned.
Yes, something like this. For example, I run via vorpal command a bot (ie: a trading bot), a service in background, later on I can run again the vorpal application and interact with that service running other vorpal commands (see stats, check progress, stop bot, change configuration, restart it)
Jens Kallup
how can i embed vorpal in website?
Graham Holden
Just started using Vorpal and got the basics in place... node myapp.js will open an interactive session and prompt for commands; node myapp.js mycmd myarg will run a command and return to the command-prompt. Is there a way of giving one or more commands on the command-line and then switching to accepting commands interactively? At the moment, after command-definition, I've got vorpal.parse( process.argv ).show() ;. TIA
So how dead is vorpal.js? Or is there a viable fork somewher
Robert Kraig
is it possible to write a vorpal cli without being stuck in the event loop? like.. node cli.js mycommand:name --argument
hrrgh. why do my commands uh, say their name?
[nodemon] starting `node index.js`
listening on port 3000
op$ help
op$ help


    help [command...]  Provides help for a given command.
    exit               Exits application.
    say <message>      Sends a `serverchat` to the connected clients.

the second help isn't me typing it in
Quick question. I was looking to have the commands separated into their own files and stored in a "commands" folder. Has anyone found a good way to do this?
Never mind, I figured out an easy way. Just used require-all and _.forOwn with vorpal.use
const commands = require('require-all')(__dirname + '/commands');
const _ = require("lodash")
_.forOwn(commands, function(value, key) {
Joe Pea
Does Vorpal not have a way to do that automatically based on the command specified via the CLI? (I'm new here). Importing all the commands all at once is less performant than just importing the specific command that the user wants to execute. It will evaluate all the modules instead of just one. With various alternatives to Vorpal (commander.js, Caporal, sywac, etc) I've noticed much speed up in just importing specific modules only.
@yakuzadave ^
Well, I thought that I could do vorpal.use(commands) but it wasn't liking that way, so I used this method and it requires much less setup.

each command just follows this format:

module.exports = function(vorpal, options){
    // insert vorpal command here
was following this bit of the docs as a guide:
Ido Samuelson
is there a way to have a default option defined?
Joe Pea
@yakuzadave I just looked at the require-all package, and as I suspected, it requires all things at once. This will be bad for performance (more noticeable the bigger the CLI gets).
Ideally, if the CLI has three commands a, b, and c, then running the-cli a only imports and executes code from a.js while never touching files for b and c (or similar).
Now imagine the CLI has hundreds of commands, or commands with many options that import logic from different files.

But I suppose you can mitigate it by doing this (based on your snippet of code)

module.exports = function(vorpal, options){
    const dep = require('dependency-needed-by-your-command')

instead of

const dep = require('dependency-needed-by-your-command')

module.exports = function(vorpal, options){  

Each command imports all of its dependencies only when called.

But if you move the require or import statements outside of the command functions, then it means when the index files loads all commands it will import every dependency for every command even if the commands aren't all used.
Ryan Proud
What would be the correct way to escape a single-quote for a vorpal options?