@natsuneko-laboratory/unitypackage
v1.0.2
Published
Archive / Extract / Search UnityPackage from Node.js, written in TypeScript. No platform dependency.
Downloads
4
Maintainers
Readme
@natsuneko-laboratory/unitypackage
Archive / Extract / Search UnityPackage from Node.js, written in TypeScript. No platform dependency.
Requirements
- Node.js >= 18
Install
$ npm add @natsuneko-laboratory/unitypackage
$ yarn add @natsuneko-laboratory/unitypackage
$ pnpm add @natsuneko-laboratory/unitypackage
Usage
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)
});
Development
# prepare
$ pnpm install
# publish
$ npm publish --access public
License
MIT by @6jz