2020-05-18

Updated: 2024/7/3
Read Time: 5 min
Bot.js Pro 9 Released — Introduces Node.js Engine (Second Generation API)

Bot.js Pro 9

Bot.js Pro 9 introduced the Node.js (V8) engine to the script execution environment, marking the beginning of the second-generation API and significantly expanding performance and ecosystem capabilities.
This version targets high-performance script execution and rich ecosystem expansion, suitable for building complex automation, network services, and multi-module integrated applications.


Version Overview

Node.js Engine (V8)

  • Uses V8 engine to improve execution speed and memory efficiency;
  • Coexists with Rhino, maintaining backward compatibility for old scripts:
    • Rhino API → API v1
    • Node.js API → API v2
  • Supports ES6+ syntax, modular imports, and modern JS features.

Core Features and Advantages

  1. NPM Ecosystem Integration
    • Can directly install and use NPM packages (such as ws, express, axios, lodash, etc.);
    • Supports scenarios like network requests, WebSocket, HTTP services, and small server setup;
    • Extends script functionality, breaking traditional limitations.
  2. High-Performance Script Execution
    • Compared to Rhino, Node.js offers higher execution efficiency;
    • Supports long-running tasks, asynchronous operations, and multi-threading scenarios.
  3. Modularization and Package Management
    • Scripts can be split into modules with unified dependency management;
    • Improves script maintainability and team collaboration efficiency.
  4. Development and Debugging Experience Optimization
    • Remote logging and breakpoint debugging optimization;
    • Supports Node.js debugging tools (such as VS Code debugging, Inspector, etc.).
  5. Backward Compatibility
    • Old scripts can continue to run in Rhino mode;
    • New projects are recommended to prioritize using Node.js API.

Compatibility and Migration Recommendations

  • Rhino API Special Features: Some control operations and plugin interfaces need adaptation for Node.js environment;
  • New Projects: Recommended to directly use Node.js API to fully leverage performance and ecosystem advantages;
  • Legacy Project Migration: Can migrate gradually while ensuring stable operation of existing scripts.

Historical Significance

  • Bot.js Pro 9 introduced the second-generation API and Node.js engine, ushering in the era of high-performance scripts and modern JS development;
  • Established an extensible ecosystem supporting rich network and local service functionalities;
  • Laid the foundation for subsequent versions' pluginization, remote control, and cloud integration.