Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chmod-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chmod-webpack-plugin

chmod-webpack-plugin <a href="https://www.npmjs.com/p

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
139
Maintainers
1
Weekly downloads
 
Created
Source

chmod-webpack-plugin

This plugin allows you to set files and directories permissions after bundle compilation.

Installation

npm i --save chmod-webpack-plugin

Example

// webpack.conf.js
const ChmodWebpackPlugin = require("chmod-webpack-plugin");

module.exports = {
    plugins: [
        new ChmodWebpackPlugin([
                                   {path: "dist/dist/", mode: 660},
                                   {path: "dist/bin/**"},
                                   {path: "dist/public/", mode: 640},
                               ],
                               {
                                   verbose: true,
                                   mode:    770,
                               }),
    ],
};

Usage

// webpack.conf.js
const ChmodWebpackPlugin = require("chmod-webpack-plugin");

module.exports = {
    plugins:[
            new ChmodWebpackPlugin(config [, commonOptions])
    ]
}
config (required)

Object or array of objects

const config = {
    // Required, string or array of strings
    // Globs that match files/paths to set permissions
    path,
    
    // Same as path parameter, but ,atched paths will will be ignored
    exclude:         [],
    
    // Path that will be treated as relative root for globs
    // By default it is a webpack's directory
    root:            path.dirname(module.parent.filename),
    
    // Permissions to set
    mode:            644,
    
    // If true will output the result of each matched path processing
    verbose:         false,
    
    // If true will not generate any console output (excepting errros)
    silent:          false,
    
    // If true will only emulate permissions change
    dryDun:          false,
    
    // If true only files will be processed
    filesOnly:       false,
    
    // If true only directories will be processed
    directoriesOnly: false, 
};
common options (optional)

Object of parameters tat will be used as default for all configs.
Has the same structure with config entity, instead of .path parameter, which is ignored here.

Tests

npm i
npm run test

Coverage

npm i
npm run test:coverage

Keywords

FAQs

Package last updated on 24 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc