diff --git a/README.md b/README.md index 45229bb42b64479261f9d6dfc77ee1e32108082a..209c2671678feccc08f00c94f53325224ad2c6bb 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ - [ts2abc ](#ts2abc-) - [Introduction](#introduction) - [Directory Structure](#directory-structure) - - [Note](#note) + - [Build](#Build) - [Usage Guidelines](#usage-guidelines) - [Repositories Involved](#repositories-involved) @@ -28,13 +28,27 @@ For more infomation, see: [ARK Runtime Subsystem](https://gitee.com/openharmony/ ``` -## Note +## Build -ts2abc uses the command line interaction mode and converts JS code into ARK bytecode files that can be run on an ARK runtime system. ts2abc supports Windows, Linux, and macOS. +ts2abc uses the command line interaction mode and converts JS code into ARK bytecode files that can be run on an ARK runtime system. ts2abc supports Windows, Linux, and macOS. Front-end tools, converting JS source code into ARK bytecode, can be built by specifing the `--build-target` with `ark_ts2abc` on Linux. + +``` +$ ./build.sh --product-name Hi3516DV300 --build-target ark_ts2abc +``` ### Usage Guidelines -You can run **node --expose-gc _your\_path_\_to/index.js \[options\] _your\_file_.js** to convert a JS file into an ARK bytecode file using ts2abc. If no parameter is specified for **\[options\]**, an ARK binary file is generated by default. The **index.js** file is the executable file generated after ts2abc compilation. +Install `node` and `npm` + +convert JS to ARK bytecode + +``` +$ cd out/ohos-arm-release/clang_x64/ark/ark/build +$ npm install +$ node --expose-gc src/index.js [options] file.js +``` + +If no parameter is specified for **\[options\]**, an ARK binary file is generated by default.