Archive / Extract / Search UnityPackage from Node.js, written in TypeScript. No platform dependency.
- Node.js >= 18
$ npm add @natsuneko-laboratory/unitypackage
$ yarn add @natsuneko-laboratory/unitypackage
$ pnpm add @natsuneko-laboratory/unitypackage
import { archive, extract } from "@natsuneko-laboratory/unitypackage";
// create a unitypackage
await archive({
files: [
// files to archive
"/path/to/assets/MonoBehaviour.cs",
"/path/to/assets/Prefab.prefab",
],
root: "/path/to", // unity project root
dest: "/path/to/archive.unitypackage", // destination path
transform: (path) => join("Assets", join), // transform path (optional)
});
// extract a unitypackage
await extract({
file: "/path/to/archive.unitypackage",
root: "/path/to", // unity project root
transform: (path) => join("Assets", join), // transform path (optional)
});
# prepare
$ pnpm install
# publish
$ npm publish --access public
MIT by @6jz