简体   繁体   中英

How to pass cli args in Slimerjs?

I have a process in Slimerjs that I run through a child_process Nodejs and I need to pass it some arguments.

I know how to use cli args with Nodejs

var args = process.argv.slice(2);

And also with Casper

var casper = require("casper").create();

casper.echo("Casper CLI passed args:");
require("utils").dump(casper.cli.args);

casper.echo("Casper CLI passed options:");
require("utils").dump(casper.cli.options);

casper.exit();

However, I don't know how to use them in Slimerjs . Any ideas?

Thanks

SlimerJS documentation is pretty vocal about using arguments: https://docs.slimerjs.org/current/api/system.html#args

var system = require('system')
var numberOfArg = system.args.length;
var thirdArgument = system.args[2];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM