Menu

Methods

@natsuneko-laboratory/unitypackage provides the following method(s).

archive(files: string[], root: string, dist: string): Promise<void>

Signature

ParameterTypeRequiredDescription
filesstring[]YesPath to files of meta to be archived
rootstringYesPath to root directory of project
diststringYesPath to output UnityPackage

Description

Create UnityPackage from your Unity project.

Exception

Exception NameDescription
ErrorThrown if files is empty or root is not directory or dist is not file

Example

import { archive } from "@natsuneko-laboratory/unitypackage";

await archive(
  ["Assets/Plugins/MyPlugin.cs.meta"],
  "./",
  "./output.unitypackage"
);