Wondering what’s next for npm?Check out our public roadmap! »


    0.3.1 • Public • Published


    A lightweight utility for installing npm packages into a unity project.


    This utility was inspired and informed by the work done by shadowmint; many thanks to him for blazing the trail. This utility encapsulates the boilerplate of installing packages into a Unity3D project.


    Add unity-package-installer as a dependency to your package.json file. Information on the latest version can be found here.

      "unity-package-installer": ">=0.3.0"

    Automatic installation of packages

    To subscribe to automatic installation of your package into a unity project after npm install, add a unity_package_installer config.

      "unity_package_installer": {
        "source": "Source",
        "path": "Test Module"
    • source: A relative path to the folder to install in your unity project
    • path: The name of the folder in unity to install to; if not provided then your package name will be used instead.

    Manual installation of packages

    You may elect to control installing your package via a post install script of your own.

      "postinstall": "node scripts/postinstall.js"

    The following example will copy the contents of sourceFolder into Assets/Packages/My Unity Package.

    const PACKAGE_NAME = 'My Unity Package';
    var installer = require('unity-package-installer');
    var path = require('path');
    // set the package source to ./../Files/My Unity Package/Source
    var sourceFolder = path.join(__dirname, '..', 'Files', PACKAGE_NAME, 'Source');
    // install the source into unity
    installer.install(sourceFolder, PACKAGE_NAME, callback);
    // optional callback
    function callback(err, dir) {
      // err - an error which occurred while trying to install your package
      // dir - the directory within the unity project that was source copied to

    As demonstrated, you may provide a callback to the installer if you want/need to perform additional actions after your files are copied into your project.


    I plan on using this utility with something I'm developing now, and already have a few improvements in mind. If you think of any, please feel free to create an issue!

    Bug reports

    Please, file an issue if you notice anything not working as you think it should.


    npm i unity-package-installer

    DownloadsWeekly Downloads






    Last publish


    • avatar