Pass option to node via guest worker config

#1

Hello everybody.

Is it possible to send the node argument via config?

CLI usage example
node -r source-map-support/register compiled.js

I tried to pass an argument in the “arguments” in config.json file like this
{
“type”: “guest”,
“executable”: “node”,
“arguments”: [
“-r source-map-support/register”,
“./dist/crossbar.js”
]

}
But console shows “bad option: -r source-map-support/register” and completely ignores this line.

Is there any workaround or way to solve this problem?

0 Likes

#2

Hi,

“-r source-map-support/register”,

those are 2 arguments, hence try:

“-r”, “source-map-support/register”,

(the args from the list are not simply concatenated, but provided to the spawned executable via a proper syscall)

sidenote: there are also options to pass stuff as stdin to the executable:

Cheers,

/Tobias

···

https://crossbar.io/docs/Guest-Configuration/
Am 22.01.19 um 10:28 schrieb
:

dshym...@vivasg.com

Hello everybody.

Is it possible to send the node argument via config?

CLI usage example
node -r source-map-support/register compiled.js

I tried to pass an argument in the “arguments” in config.json file like this
{
“type”: “guest”,
“executable”: “node”,
“arguments”: [
“-r source-map-support/register”,
“./dist/crossbar.js”
]

}
But console shows “bad option: -r source-map-support/register” and completely ignores this line.

Is there any workaround or way to solve this problem?

  You received this message because you are subscribed to the Google

Groups “Crossbar” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to crossbario+...@googlegroups.com.

  To post to this group, send email to cross...@googlegroups.com.

  To view this discussion on the web visit [https://groups.google.com/d/msgid/crossbario/c7c18c4e-896d-4886-9871-df4bcde75cf3%40googlegroups.com](https://groups.google.com/d/msgid/crossbario/c7c18c4e-896d-4886-9871-df4bcde75cf3%40googlegroups.com?utm_medium=email&utm_source=footer).

  For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
0 Likes