ReferencesBare
Bare CLI
Reference for the bare command: evaluate a script, start a REPL, and the flags for inspecting, evaluating, and printing.
stable
The bare command runs a script on the Bare runtime or starts a REPL. Install it globally with:
npm i -g bareUsage
bare [flags] [filename] [...args]Evaluate a script, or start a REPL session if no script is provided.
Arguments
[filename] Optional. The name of a script to evaluate
[...args] Additional arguments made available to the scriptArguments after filename are passed through to the script and are available as Bare.argv.
Flags
--version|-v Print the Bare version
--eval|-e <script> Evaluate an inline script
--print|-p <script> Evaluate an inline script and print the result
--inspect Activate the inspector
--inspect-port <port> Configure the inspector port (default: 9229)
--expose-gc Expose garbage collection APIs
--help|-h Show helpModule loading
The specified filename (or inline --eval script) is run with Module.load(), which resolves both CommonJS and ESM and provides interop between them. For the supported formats and resolution rules, see bare-module.
See also
- Bare runtime API—the
Bareglobal available to scripts you run. - Inside Bare—what the runtime is and why it's minimal.
- Start from the hello-pear-bare template—a terminal app run with
bare bin.js. - Bare modules—the standard library available to scripts.