api改进

This commit is contained in:
shenjack 2024-05-09 00:19:25 +08:00
parent abc3858d3a
commit 61cd0f3611
Signed by: shenjack
GPG Key ID: 7B1134A979775551

View File

@ -29,7 +29,7 @@ let run_env = {
from_code: (typeof window == "undefined"), from_code: (typeof window == "undefined"),
is_node: (typeof Bun == "undefined"), is_node: (typeof Bun == "undefined"),
is_bun: (typeof Bun != "undefined"), is_bun: (typeof Bun != "undefined"),
cli_args: [], version: _version_,
}; };
/** /**
@ -130,19 +130,12 @@ function fmt_RunUpdate(update) {
} }
if (run_env.from_code) { if (run_env.from_code) {
console.log("正在运行 md5.js 作为单独的脚本");
console.log("版本号: " + _version_);
let fs = require("fs"); let fs = require("fs");
let path = require("path"); let path = require("path");
let EventEmitter = require("events"); let EventEmitter = require("events");
finish_trigger = new EventEmitter(); finish_trigger = new EventEmitter();
// 把 cli 参数传进来
run_env.cli_args = process.argv;
// 整一套虚拟的window和document // 整一套虚拟的window和document
// 但说实话十分生草
// list of elements // list of elements
let stored_elements = []; let stored_elements = [];