# Auto Unpack Native Modules Plugin

This plugin will automatically add all native Node modules in your `node_modules` folder to the [`asar.unpack`](https://electron.github.io/packager/main/interfaces/Options.html#asar) config option in your [`packagerConfig`](/config/configuration.md#electron-packager-config). If your app uses native Node modules, you should probably use this to reduce loading times and disk consumption on your users' machines.

## Installation

```shell
npm install --save-dev @electron-forge/plugin-auto-unpack-natives
```

## Usage

You must add this plugin to your [`plugins`](/config/configuration.md#plugins) array in your Forge configuration. There are currently no configuration options available for this plugin.

{% hint style="info" %}
Asar archives are disabled by default with Electron Packager. Make sure you set your `packagerConfig.asar` value accordingly. This option also supports advanced configuration if you pass it an object. See the [API documentation for this option](https://js.electronforge.io/modules/_electron_forge_shared_types.InternalOptions.html#CreateOptions) for more information.
{% endhint %}

{% code title="forge.config.js" %}

```javascript
module.exports = {
  packagerConfig: {
    asar: true // or an object containing your asar options
  },
  plugins: [
    {
      name: '@electron-forge/plugin-auto-unpack-natives',
      config: {}
    }
  ]
};
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.electronforge.io/config/plugins/auto-unpack-natives.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
