0

in my apps.js file, I have the following code:

const yargs=require('yargs');
const argv=yargs.argv;
console.log('yargs',argv);

And when I run the command normally I get:

> node app.js read --title="to by"
yargs { _: [ 'read' ],
  help: false,
  version: false,
  title: 'to by',
  '$0': 'app.js' }

however when I use nodemon, I get the wrong parameters if there is a space in title:

> nodemon app.js read --title="to by"
yargs { _: [ 'read', '"--title=to', 'by"' ],
  help: false,
  version: false,
  '$0': 'app.js' }

So the app does not run correctly. WHat is going on here? Thanks

Rik
  • 1,870
  • 3
  • 22
  • 35

1 Answers1

0

I could be very wrong but try without equals = when passing the argument in the terminal like this.

    nodemon app.js read --title "to by"