Options
All
  • Public
  • Public/Protected
  • All
Menu

Auto.js Pro V9 Docs

中文版本请点击中文Readme

Auto.js Pro V9 is still in the internal testing, the document is generated by code and under improvement. Join the internal testing with Telegram invite link https://t.me/joinchat/ExZ-DlDaQmn7Mswy .

Auto.js Pro V9 is the next major release of Auto.js Pro, it will support Node.js and the Chrome V8 engine, bringing NPM ecology and still supports Android/Java interaction (which means you can use Android/Java APIs in the Node.js!).

For Auto.js Pro V9 Roadmap, see https://github.com/hyb1996/auto.js/issues/526 .

Quick start

Even if in the Auto.js Pro V9, code is running with Rhino engine by default, you need use one of the following ways to enable Node.js engine:

  1. Put the exact statement "nodejs"; before any other statements.
"nodejs";

console.log(`Node.js version: ${process.version}`);
  1. Rename the file to end with .node.js (supported at Pro 9.0.5) or .mjs.(supported at Pro 9.0.0). The .mjs file will also enable ECMAScript modules supports, see https://nodejs.org/api/esm.html

API compatibility

Auto.js Pro V9 redesign the APIs with the new Node.js engine, so it is not fully compatible with the old Rhino engine. See Modules.

To use the old V8 APIs in the new Node.js engine, we will provide the legacy-apis module to help you migrate the old code.

For interactions with Java in the Node.js, the rhino module will provide APIs like Rhino.

npm

Auto.js Pro V9 supports installing module through the NPM. Visit @autojs for npm modules for Auto.js Environment.

In the built-in terminal, you can use the node and npm command to execute code and run npm, install other package managers or command-line tools.

ui

Since it is difficult to run Node.js in the Android UI/main thread, we will provide WebView API to create WebView and show HTML as User Interface.

To be continued...

Generated using TypeDoc