# webpack-permissions-plugin

> A webpack plugin to set permissions for your output files and folders

Latest version **1.0.10** (published 2024-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install webpack-permissions-plugin
pnpm add webpack-permissions-plugin
yarn add webpack-permissions-plugin
bun add webpack-permissions-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2024-07-08 |
| First published | 2017-06-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | George Kormaris |
| Maintainers | gekorm |
| Keywords | webpack, plugin, permissions, node, chmod |

## Links

- npm: https://www.npmjs.com/package/webpack-permissions-plugin
- Repository: https://github.com/GeKorm/webpack-permissions-plugin
- Issues: https://github.com/GeKorm/webpack-permissions-plugin/issues
- npm.io page: https://npm.io/package/webpack-permissions-plugin

## Dependencies (1)

- [filehound](https://npm.io/package/filehound.md) ^1.17.6

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.10 (latest) — 2024-07-08
- 1.0.2-beta.0 (beta) — 2018-11-16
- 1.0.9 — 2023-01-03
- 1.0.8 — 2021-01-31
- 1.0.7 — 2020-02-10
- 1.0.6 — 2019-09-01
- 1.0.5 — 2019-08-19
- 1.0.3 — 2019-04-11
- 1.0.0 — 2018-02-26
- 0.0.2 — 2017-06-13
- 0.0.1 — 2017-06-13

## README

# Webpack Permissions Plugin

A webpack plugin to manage the permissions of output files and directories  
Tested with **Webpack 2, 3 and 4**

### Install

- Yarn: `yarn add -D webpack-permissions-plugin`
- Npm: `npm i -D webpack-permissions-plugin`

### Usage

**buildFolders** (_String: path_) The directories to chmod recursively  
**buildFiles** (_String: path_) The specific files to chmod

Files under _buildFolders_ get file-specific permissions.

###### Simple: Directories 644, Files 755

```javascript
const PermissionsOutputPlugin = require('webpack-permissions-plugin');

plugins.push(
  new PermissionsOutputPlugin({
    buildFolders: [
      path.resolve(__dirname, 'resources/'),
      path.resolve(__dirname, 'dist/')
    ],
    buildFiles: [
      path.resolve(__dirname, 'someFile.js'),
      path.resolve(__dirname, 'dist/app.js')
    ]
    // dist/app.js is redundant, it already got 755 by being included in the buildFolder above
  })
);
```

###### Advanced: Per-path modes

Mode: an octal string or octal integer (eg. `755` or `0o755`)

```javascript
const PermissionsOutputPlugin = require('webpack-permissions-plugin');

plugins.push(
  new PermissionsOutputPlugin({
    buildFolders: [
      {
        path: path.resolve(__dirname, 'resources/'), // Everything under resources/ gets these modes
        fileMode: '755',
        dirMode: '644'
      },
      {
        path: path.resolve(__dirname, 'dist/'), // Everything under dist/ gets these modes
        fileMode: '755',
        dirMode: '644'
      }
    ],
    buildFiles: [
      {
        path: path.resolve(__dirname, 'someFile.js'),
        fileMode: '755'
      },
      {
        path: path.resolve(__dirname, 'dist/app.js'),
        fileMode: '777' // Overrides previous dist/ mode
      }
    ]
  })
);
```

---
_Source: https://npm.io/package/webpack-permissions-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
