Joshua Terrill
Joshua Terrill

Reputation: 2017

Passing command line arguments to a node-webkit-builder project

In node webkit you can pass arguments via commandline to a nw.exe file like --url="foo". I've got a project that is compressed and packaged using Node Webkit Builder https://github.com/mllrsohn/node-webkit-builder which gives me an outputted exe, but when I try to pass command line arguments to it like the one above, it hangs up and creates some nw.exe processes, but no window appears and it breaks.

Has anyone had any luck with this?

Upvotes: 1

Views: 1917

Answers (1)

Jaredcheeda
Jaredcheeda

Reputation: 2022

The specific command you want (--url="website-url") comes built in:

If you want to access that arg or any other from within your app, use this:

var myArgs = require('nw.gui').App.argv;

myArgs will be an array containing all arguments.

Upvotes: 0

Related Questions