Skip to content

快速开始

nsuite 从一个包入口导出公开工具。脚本或服务只需导入实际需要的函数。

安装

bash
npm install nsuite

该包支持 Node.js 18 及更高版本,并提供 TypeScript 类型声明。

导入工具

ts
import { getDirname, getFilePath, writeFileSafely } from "nsuite";

const filePath = getFilePath(import.meta.url);
const directory = getDirname(import.meta.url);

await writeFileSafely(`${directory}/output.txt`, "Generated by nsuite.", {
  encoding: "utf8",
});

按任务选择指南

Released under the Apache-2.0 License.