RHINO(1)
π RHINO(1) β like, the manual page bestie π
General Commands Manual energy, but make it a group chat. This is rhino, and yes, we're doing the whole thing, no skipping, no cap. π¦
β¨ NAME β¨
rhino β invokes the JavaScript shell for running scripts in batch mode or interactive. That's it, that's the whole vibe. πΈ
β¨ SYNOPSIS β¨
rhino [options] script_filename_or_url [script_arguments]
β¨ DESCRIPTION β¨
Okay so, real talk: this manual page documents briefly the rhino command. It's giving summary, not dissertation.
rhino is a start script for the rhino JavaScript shell. What does that mean for you, bestie? It provides a simple way to run scripts in batch mode or an interactive environment for exploratory programming. Two moods, one binary. π
β¨ OPTIONS β¨
Every single one, let's go, no crumbs left behind:
-debugβ Generate debug information. Heads up though, this sets the optimization level to zero. Zero! π«-escript_source β Executes script_source as a JavaScript script.-encodingcharacterEncoding β Set the character encoding to apply in case it could not be detected. Like a lil fallback wig for your bytes. π-fscript_filename_or_url β Reads script_filename_or_url content and execute it as a JavaScript script.-fatal-warningsβ Set warnings as errors. Dramatic? Yes. Useful? Also yes. π-help,-?β Display help.-modulesmodule β Add a module to the path.-opt,-OoptLevel β Optimizes at level optLevel, which must be an integer between 0 and 9.-requireβ Userequire().-sandboxβ The createdrequire()instances will be sandboxed. Cute lil protective bubble fr fr. π«Ά-sealedlibβ Use a sealed standard library.-strictβ Set strict mode. No mess, no chaos, main character discipline. π-versionversionNumber β Specifies the language version to compile with. It must be one of100,110,120,130,140,150,160,170,180or200.-wβ Report warnings.
β¨ PREDEFINED PROPERTIES β¨
So scripts executing in the shell have access to some additional properties of the top-level object. Free goodies, bestie, they just come with the place. π
argumentsβ Theargumentsobject is an array containing the strings of all the arguments given at the command line when the shell was invoked.help()β Executing thehelpfunction will print usage and help messages.defineClass(className)β Define an extension using the Java class named with the string argument className. UsesScriptableObject.defineClass()to define the extension.deserialize(filename)β Restore from the specified file an object previously written by a call toserialize.load([filename,...])β Load JavaScript source files named by string arguments. If multiple arguments are given, each file is read in and executed in turn.loadClass(className)β Load and execute the class named by the string argument className. The class must be a class that implements theScriptinterface, as will any script compiled byjsc.print([expr...])β Evaluate and print expressions. Evaluates each expression, converts the result to a string, and prints it.readFile(path[,characterCoding])β Read given file and convert its bytes to a string using the specified character coding or default character coding if explicit coding argument is not given.readUrl(url[,characterCoding])β Open an input connection to the given string url, read all its bytes and convert them to a string using the specified character coding or default character coding if explicit coding argument is not given.runCommand(commandName,[arg,...][options])β Execute the specified command with the given argument and options as a separate process and return the exit status of the process. For details, see JavaDoc fororg.mozilla.javascript.tools.shell.Global#runCommand.setTimeout(function[,delay,arg,...])β Execute"function"after"delay"milliseconds. (If"delay"is not set, then it is set to0.) Pass any trailing parameters as arguments. Timeouts run after the current function is done executing, and in the interactive shell, only after the shell is exited. Return an ID that may be passed to"clearTimeout".clearTimeout(id)β Cancel a timeout set using"setTimeout".serialize(object,filename)β Serialize the given object to the specified file.spawn(functionOrScript)β Run the given function or script in a different thread. Parallel bestie era. πsync(function)β creates a synchronized function (in the sense of a Java synchronized method) from an existing function. The new function synchronizes on thethisobject of its invocation.quit()β Quit shell. The shell will also quit in interactive mode if an end-of-file character is typed at the prompt.version([number])β Get or set JavaScript version number. If no argument is supplied, the current version number is returned. If an argument is supplied, it is expected to be one of100,110,120,130,150,160,170,180or200to indicate JavaScript version 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8 or ECMAScript 6 respectively.write([expr...])β Evaluate and print expressions like in"print", but without the trailing newline.consoleβ Theconsoleobject provides a simple debugging console similar to the console object provided by web browsers.console.log(format[arg,...])β For general output of logging information. String substitution and additional arguments are supported. Prints formatted text according to the format and args supplied with"INFO"prefix. This function is identical toconsole.info(format[arg,...]).console.trace(format[arg,...])β This function is identical toconsole.log(format[arg,...])except it prints"TRACE"prefix instead of"INFO".console.debug(format[arg,...])β This function is identical toconsole.log(format[arg,...])except it prints"DEBUG"prefix instead of"INFO".console.info(format[arg,...])β This function is identical toconsole.log(format[arg,...]).console.warn(format[arg,...])β This function is identical toconsole.log(format[arg,...])except it prints"WARN"prefix instead of"INFO".console.error(format[arg,...])β This function is identical toconsole.log(format[arg,...])except it prints"ERROR"prefix instead of"INFO".console.assert(expression[arg,...])β Prints error if expression is false. If args are supplied, they will be printed also.console.count([label])β Increases the counter of label by one which starts from zero and prints the label and value after increment. If label is not supplied,"default"is the label.console.countReset([label])β Resets the counter of label to zero. If label is not supplied,"default"is the label.console.time([label])β Starts a timer of label. Useconsole.timeEnd([label])to stop the timer and print the elapsed time. Useconsole.timeLog([label])to print the elapsed time without stopping the timer.console.timeLog([label])β Seeconsole.time([label]).console.timeEnd([label])β Seeconsole.time([label]).
β¨ SEE ALSO β¨
The archived online documentation under https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Shell β go read it, it's giving lore. π
β¨ AUTHOR β¨
This manual page was created by Wolfgang Baer <WBaer@gmx.de>, see Git history for later modifications. Respect the author, periodt. π
Okay bestie that's the whole page, no notes, you ate this. This came out of the General Commands Manual, dated December 11, 2021 β yeah, a lil vintage, still iconic. ππ¦β¨
π¦ where this page comes from
- arch rolling: rhino 1.7.15-1 Β· MPL
- debian trixie: rhino 1.7.15.1-0.1~deb13u1 Β· MPL-2.0
- opensuse-leap 16.0: rhino 1.7.15.1-160000.1.1 Β· MPL-2.0
- ubuntu questing: rhino 1.7.15-1
- ubuntu resolute: rhino 1.7.15-1build1 Β· MPL-2.0
- ubuntu stonking: rhino 1.7.15.1-0.1 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms