We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Trying to start the CLI with some imported module. For example, trying to load quickjs-require. This is what I tried so far:
bash $ curl -sOL https://raw.githubusercontent.com/IvanGaravito/quickjs-require/master/require.js bash $ ./qjs --interactive --std --module require.js QuickJS - Type "\h" for help qjs > require ReferenceError: 'require' is not defined at <eval> (<evalScript>) qjs > ctrl^d bash $ ./qjs --interactive --std --script require.js SyntaxError: expecting '(' at require.js:1 bash $ ./qjs --interactive --std -I require.js QuickJS - Type "\h" for help qjs > require ReferenceError: 'require' is not defined at <eval> (<evalScript>) qjs > ctrl^d bash $ ./qjs QuickJS - Type "\h" for help qjs > import { require } from '../require.js' SyntaxError: expecting '(' at <evalScript>:1 qjs > bash $
I am obviously a little confused as what can be done with the CLI and how but any guidance is appreciated.
I found a way to load it once the CLI is started:
QuickJS - Type "\h" for help qjs > import('require.js').then(require => this.require = require) { } qjs > require { require: function require() }
The text was updated successfully, but these errors were encountered:
I found a way to "preload" modules but that's not so elegant:
bash $ cat > test.js import('require.js').then(require => this.require = require); bash $ ./qjs --interactive --script test.js QuickJS - Type "\h" for help qjs > require { require: function require() }
Sorry, something went wrong.
The CLI is not really adapted to use modules. You should use a script to test the require.js module.
No branches or pull requests
Trying to start the CLI with some imported module. For example, trying to load quickjs-require. This is what I tried so far:
I am obviously a little confused as what can be done with the CLI and how but any guidance is appreciated.
I found a way to load it once the CLI is started:
The text was updated successfully, but these errors were encountered: