Closed aheissenberger closed 2 years ago
If you have Node 17.5.0 installed this will work. DataStation uses your existing Node under the hood.
Otherwise you could wrap the panel in an async function and call it:
(async function() {
let transform = DM_getPanel(1);
const res = await fetch('https://datastation.multiprocess.io',{method: 'HEAD'})
transform=await res.text()
DM_setPanel(transform);
})()
I have v17.6.0
and it did not work.
How can I add an parameter when the binary is called? adding it in settings fails:
[INFO] 2022-02-23T16:43:25 Failed to eval: fork/exec /opt/homebrew/bin/node --experimental-fetch: no such file or directory
Yeah you can't do that yet. I'll add support for it in the next release but until then you might be able to write a bash program:
$ cat /usr/local/bin/node-fetch
#!/usr/bin/env bash
set -e
exec node --experimental-fetch "$@"
$ chmod +x /usr/local/bin/node-fetch
And set /usr/local/bin/node-fetch to be the Node program to execute in settings.
I had to use an absolute path to the node binary but it worked.
Node.js v17.5.0 - supports top level async functions and fetch
How to use async functions - eg.
Error: