A command-line interface for ratel-core, a JavaScript to JavaScript compiler written in Rust.
ratel [options]
ratel --version
Options:
-h --help Show this screen.
--version Show version.
-e STRING, --string=STRING Specifies an input string.
-f FILE, --file=FILE Specifies the input file.
-o FILE, --output=FILE Specifies the output file.
--pretty Don't minify the output.
--ast Print out the Abstract Syntax Tree of the input.
You can install the executable globally from NPM using
npm install -g ratel or by executing npm link in the project
directory.
Runs all tests using Mocha.
The test suite is using node.green's compat-table which features ES2015, ES2016 and ES2017 examples.
$ npm testAdditionally, you can execute make in the project directory in order to
validate the source code. Please also refer to the scripts section of
package.json for further options.
Currently, ratel-core is provided as git submodule for development purposes.
Run the following command to execute all bundled tests and write the original
sources, errors and results to the results directory:
$ node write_errors.jsimport Ratel from 'ratel';
const instance = new Ratel();Returns a string containing the application's version.
Returns a string containing usage information.
Transpiles the given input, returns optionally a string.
options is an object which can take the following values:
| key | type | purpose |
|---|---|---|
| file | String | Input path. |
| ast | Boolean | Whether to return the AST. |
| output | String | Output path. |
| string | String | Input string. |
Reference to the rust module implementing the following methods:
Returns a string.
Transforms the given input string into ES5 code. When minify is set to true, the output string will be minified.
Returns a String with the AST of the given input string.
0.0.6
- Ensuring trailing newlines
0.0.5
- Updating tests
- Removing compat-table transform tests (for now)
- Adding tests for transform, pretty printing
- Writing original sources, errors and results in write_errors
0.0.4
- Renaming to ratel
- Updating to ratel-core 0.2.3
- Updating documentation
- Updating project dependencies
0.0.3
- Updating to HoneyBadger 0.2.1
- Updating documentation
- Ensuring a trailing newline using -e/--string
0.0.2
- Updating to HoneyBadger 0.2.0
- Updating documentation
- Adding -e/--string to provide a string
- Adding stand-alone executable
- Adding unit tests
- Adding tests from node.green's compat-table
- improved API
- MIT
- Apache License Version 2.0
