-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submit Your Feature Requests and Ideas #10
Comments
Can I also inject javascript objects from the main process into the QuickJS runtime? I'm building a node express based data server, where I want to allow clients to run javascript queries on that data (https://github.com/SimplyEdit/SimplyStore/) |
Hey @poef Yes, you can. See Data Exchange Between Host and Guest const { evalCode } = await createRuntime({
env: {
MY_PROCESS_ENV: 'some environment variable provided by the host',
KV: {
set: (key: string, value: string) => keyValueStoreOnHost.set(key, value),
get: (key: string) => keyValueStoreOnHost.get(key),
},
},
}) |
Read standard input to V8's |
@guest271314 thanks for your feedback. As far as I understand, if the "regular" deadline nodejs module is available inside of the quickjs runtime, it should solve the issue or? const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
rl.on('line', (line) => {
console.log(line);
});
rl.once('close', () => {
// end of input
}); |
Where does Node.js API's get in to your WASM QuickJS build? The idea is to use the least amount of resources to read I was thinking I could use WebAssembly/WASI to read stdin to |
I'm basically trying to do this https://github.com/guest271314/native-messaging-webassembly without a WASM runtime, using the built-in |
What I was meaning is, that you can provide functions and data from a regular Node.js host application, to the wasm guest system. |
It doesn't make sense to me to use 108.7 MB I use That's why I chose I have been trying to do this using I saw your work and this issue requesting features and decided to place a feature request.
I don't think it is possible to achieve that requirement. I have broken out of too many alleged "sandbox" to think for a moment that it can't be done in this case, too. Thanks! |
Hey, |
I don't have a use case for running applications in a "sandbox". I generally break out of sandboxes that folks try to set up. For people interested in "sandbox" code we already have that with |
Runtime Limits
I don't think its possible to include anything at present like the --allow-net feature of deno in node. However instead of marshaling (to and from) a fetch replacement which imposes this limitation within javascript. It would be desirable to look towards seeing if there is any way possible to impose a limitation on the sandbox runtime. If it was a separate process, there are ways to do this from the OS. But I have not found out a compatible solution for worker threads. However if there was any possible way to do this, it would be very good. |
Hey @digipigeon |
Hi @sebastianwessel, would you consider implementing https://nodejs.org/api/worker_threads.html#performanceeventlooputilizationutilization1-utilization2 as an alternative to accomplish something similar? |
@digipigeon Not directly in this library, as the focus is on providing a sandbox, data (de-)serialization, runtime compatibility inside the sandbox, and developer experience (DX). The developer should be free to choose the method that fits best. My recommendation is to use libraries that are specialized for this, such as the poolifier-web-worker package, which is used in the Server Example here. For instance, the usage in the browser might differ from that in the backend. In the browser, you might need only one sandbox, while in the backend, as many sandboxes as possible are required. |
Can there be |
@aashutoshrathi as quickly is used, there is the option to do something like this: ‘‘‘typescript ‘‘‘ |
@sebastianwessel and I can use |
Kind of - it highly depends on your use case and what you like to achieve I guess. Personally, I do not see any real world use case, where it makes sense, to count such things, because in this case, you will need up front what is executed in the sandbox, to find the correct value. |
If you have ideas, wishes, feature request and feedback - please add them in the comments below
The text was updated successfully, but these errors were encountered: