Gathering detailed insights and metrics for filemanager-plugin
Gathering detailed insights and metrics for filemanager-plugin
Gathering detailed insights and metrics for filemanager-plugin
Gathering detailed insights and metrics for filemanager-plugin
filemanager-webpack-plugin
Webpack plugin to copy, archive (.zip), move, delete files and directories before and after builds
filemanager
A Vue.js Plugin for arranging and labeling images. Originally developed for Figgy at Princeton University Library.
filemanager-umijs-plugin
## Installation
ained-filemanager-2
Ained-filemanager is a file manager component for vuejs.
Copy, compress/uncompress (.zip/.tar/.gz/.tgz), move, delete files or directories before and after builds.
npm install filemanager-plugin
Typescript
Module System
Min. Node Version
Node Version
NPM Version
66.6
Supply Chain
97.7
Quality
73
Maintenance
100
Vulnerability
99.6
License
JavaScript (90.62%)
HTML (9.14%)
CSS (0.25%)
Total Downloads
243,151
Last Day
34
Last Week
2,971
Last Month
11,693
Last Year
122,597
MIT License
10 Stars
183 Commits
6 Forks
1 Branches
3 Contributors
Updated on Jun 22, 2024
Minified
Minified + Gzipped
Latest Version
2.9.0
Package Id
filemanager-plugin@2.9.0
Unpacked Size
33.63 kB
Size
8.74 kB
File Count
6
NPM Version
8.9.0
Node Version
14.19.2
Published on
Jun 22, 2024
Cumulative downloads
Total Downloads
Last Day
126.7%
34
Compared to previous day
Last Week
-6.4%
2,971
Compared to previous week
Last Month
4.6%
11,693
Compared to previous month
Last Year
346%
122,597
Compared to previous year
This file manager plugin allows you to delete, zip/unzip(.zip/.tar/.tar.gz), move, rename, copy files or directories before and after webpack/rollup/vite builds. Also, you can customize the lifecycle of webpack, rollup or vite during building.
npm install filemanager-plugin --save-dev
Control the running order during building.
start {Object}
: Register actions to beforeCompile
hook to compiler. Executes a plugin after compilation parameters are created.end {Object}
: Register actions to done
hook to compiler, actions will be executed when the compilation has completed.In the example below, the start event with del
command will run first,
and then the end event with zip
after.
1// webpack 2const FileManagerPlugin = require('filemanager-plugin').WebpackFilemanager; 3module.exports = { 4 plugins: [ 5 new FileManagerPlugin({ 6 events: { 7 start: { 8 del: { 9 items: ['./dist'] 10 } 11 }, 12 end: { 13 zip: { 14 items: [ 15 {source: './src/demo0.zip', destination: './dest/demo0', type: 'zip'} 16 ] 17 } 18 } 19 } 20 }) 21 ] 22}; 23 24// rollup 25const rollupFilemanager = require('filemanager-plugin').RollupFilemanager; 26module.exports = { 27 plugins: [ 28 rollupFilemanager({ 29 events: {} // It's the same as webpack configuration 30 }) 31 ] 32}
Supports for the custom lifecycle for webpack, vite or rollup to control the running order. In addition, when
customHooks
is set,events
will be ignored.
hookName {String}
: Register hook of webpack, vite or rollup. Commands will run when each hook is called.
(webpack hooks,
rollup hooks,
vite hooks).commands {Array}
: Setting actions. Commands will run, when each hook which you registered is triggered.hookType {String}
: Depending on the hook type, It only supports webpack.1// webpack 2const FileManagerPlugin = require('filemanager-plugin').WebpackFilemanager; 3module.exports = { 4 plugins: [ 5 new FileManagerPlugin({ 6 events: { 7 start: { 8 zip: { 9 items: [ 10 {source: './src/demo0.zip', destination: './dest/demo0', type: 'zip'} 11 ] 12 } 13 } 14 }, // events will be ignore. 15 customHooks: [ 16 { 17 hookName: 'compile', 18 hookType: 'tap', 19 commands: { 20 del: { 21 items: ['./dist'] 22 // All file under './dist' will be deleted, when compile hook is called 23 } 24 } 25 } 26 ] 27 }) 28 ] 29}; 30 31// rollup 32const RollupFilemanager = require('filemanager-plugin').RollupFilemanager; 33module.exports = { 34 plugins: [ 35 new RollupFilemanager({ 36 customHooks: [ 37 { 38 hookName: 'generateBundle', 39 commands: { 40 del: { 41 items: ['./dist'] 42 // All file under './dist' will be deleted, when generateBundle hook is called 43 } 44 } 45 } 46 ] 47 }) 48 ] 49}; 50 51// vite 52const ViteFilemanager = require('filemanager-plugin').ViteFilemanager; 53module.exports = { 54 plugins: [ 55 ViteFilemanager({ 56 customHooks: [ 57 { 58 hookName: 'generateBundle', 59 commands: { 60 del: { 61 items: ['./dist'] 62 // All file under './dist' will be deleted, when generateBundle hook is called 63 } 64 } 65 } 66 ] 67 }) 68 ] 69};
Name | Type | Description |
---|---|---|
zip | {Array} | Zip files or directories by using tar , tgz , gzip or zip . However, gzip only supports compress single file. You need to use tgz to zip a directory. |
unzip | {Array} | Unzip files or directories. The usage is Same as zip . |
del | {Array} | Delete multiple files or directories. |
copy | {Array} | Copy multiple files or directories. |
move | {Array} | Move multiple files or directories. |
rename | {Array} | Rename multiple files or directories. |
These commands would be called when each hook which has been registered is called.
Also, each action will be executed in order base on Array
order.
In this example below, in the end event, the del
command will run first, and zip
after:
1// webpack 2const FileManagerPlugin = require('filemanager-plugin').WebpackFilemanager; 3module.exports = { 4 plugins: [ 5 new FileManagerPlugin({ 6 events: { 7 start: { 8 del: { 9 items: ['./dist'] 10 }, 11 zip: { 12 items: [ 13 {source: './src/demo0.zip', destination: './dest/demo0', type: 'zip'} 14 ] 15 } 16 } 17 } 18 }) 19 ] 20}; 21 22// rollup 23const rollupFilemanager = require('filemanager-plugin').RollupFilemanager; 24module.exports = { 25 plugins: [ 26 rollupFilemanager({ 27 events: {} // It's the same as webpack configuration 28 }) 29 ] 30}
zip
example1module.exports = { 2 plugins: [ 3 new FileManagerPlugin({ 4 events: { 5 end: { 6 zip: { 7 items: [ 8 { source: './src/demo1', destination: './dest/demo1.zip', type: 'zip'}, 9 { source: './src/demo2', destination: './dest/demo2.tar', type: 'tar'}, 10 { source: './src/demo3', destination: './dest/demo3.tgz', type: 'tgz'}, 11 { source: './src/demo4.html', destination: './dest/demo4.html.gz', type: 'gzip'}, 12 { source: './src/*.js', destination: './dest/demo5.js.zip'} 13 // All js files under './src' will be compressed to 'demo5.js.zip' under './dest' 14 ] 15 } 16 } 17 } 18 }) 19 ] 20}
source {String}
: Compressed source path which can be a file or directory. It supports glob pattern.destination {String}
: Compressed destination path.type {String}
: Compressed type. Default is zip
.option {Object}
: Other optional configuration for zip.unzip
example1module.exports = { 2 plugins: [ 3 new FileManagerPlugin({ 4 events: { 5 end: { 6 unzip: { 7 items: [ 8 { source: './src/demo1.zip', destination: './dest/demo1'}, 9 { source: './src/demo2.tar', destination: './dest/demo2', type: 'tar'}, 10 { source: './src/demo3.tgz', destination: './dest/demo3', type: 'tgz'}, 11 { source: './src/demo4.html.gz', destination: './dest/demo4', type: 'gzip'}, 12 { source: './src/*.zip', destination: './dest/demo5'} 13 // All zip files under './src' will be uncompressed to 'demo5' under './dest' 14 ] 15 } 16 } 17 } 18 }) 19 ] 20}
source {String}
: Uncompressed source path. It supports glob pattern.destination {String}
: Uncompressed destination path.type {String}
: Uncompressed type. Default is zip
.option {Object}
: Other optional configuration for unzip.del
example1module.exports = { 2 plugins: [ 3 new FileManagerPlugin({ 4 events: { 5 end: { 6 del: { 7 items: [ 8 './dist', 9 './temp/*.html' // All html files under './temp' will be deleted. 10 ] 11 } 12 } 13 } 14 }) 15 ] 16}
source {String}
: Deleted path which can be a file or directory. It supports glob pattern.copy
example1module.exports = { 2 plugins: [ 3 new FileManagerPlugin({ 4 end: { 5 copy: { 6 items: [ 7 // All .js files under './src/demo' will be copied to './dest/demo' and keep directory hierarchy. 8 { source: './src/demo1/**/*.js', destination: './dest/demo', isFlat: false}, 9 // All .html files under './src/demo' will be copied to './dest/demo' 10 { source: ['./src/demo/*.html'], destination: './dest/demo', globOptions: {silent: false}}, 11 // index.html under './src/demo' will be copied as 'newIndex.html' under './dest/demo' 12 { source: ['./src/demo/index.html'], destination: './dest/demo', name : 'newIndex.html'} 13 ] 14 } 15 } 16 }) 17 ] 18}
source {String | Array}
: Copied source path. It supports glob pattern.destination {String}
: Copied destination path.globOptions {Object}
: Allows to configure the glob pattern matching library used by the plugin. See the list of
supported options.isFlat {Boolean}
: Whether Removing directory structure/folder hierarchy when copying with recursive. Default is
true
.name {String}
: When you need to rename a file. Notice: It would be effective when source
is a or a list of
files. Default is empty string which means it would be ignored.copyOption {Object}
: Allows to set optional configuration for copy.move
example1module.exports = { 2 plugins: [ 3 new FileManagerPlugin({ 4 end: { 5 move: { 6 items: [ 7 { source: './src/demo1.zip', destination: './dest/demo1'}, 8 { source: './src/*.css', destination: './dest/demo'} 9 // All css files under './src' will be moved to './dest/demo' 10 ] 11 } 12 } 13 }) 14 ] 15}
source {String}
: Moved source path. It supports glob pattern.destination {String}
: Moved destination path.option {Object}
: Optional configuration for moving.rename
example1module.exports = { 2 plugins: [ 3 new FileManagerPlugin({ 4 end: { 5 rename: { 6 items : [ 7 { path: './rename', oldName: 'a.html', newName: 'b.html' } 8 ] 9 } 10 } 11 }) 12 ] 13}
source {String}
: Renamed source path.destination {String}
: Renamed destination path.The global configuration for file manager operation
parallel {Number}
: Use multi-processes parallel running to improve the task speed.
Max number of concurrent runs: os.cpus().length - 1
. Default is closing.log {String}
: Show which information you need during building. Default is all
.1const FileManagerPlugin = require('filemanager-plugin').WebpackFilemanager; 2 3module.exports = { 4 plugins: [ 5 new FileManagerPlugin({ 6 events: { 7 start: { 8 del: { 9 items: ['./dist'] 10 } 11 } 12 }, 13 options: { 14 parallel: 3, 15 log: 'all' 16 } 17 }) 18 ] 19}; 20// start with three process to run task. 21// success: delete './dist'
cache {Boolean}
: If you set true
, it would only once during building. It's highly efficient for development
mode. Also, you can override the value by each action. Default is true
.1const FileManagerPlugin = require('filemanager-plugin').WebpackFilemanager; 2 3module.exports = { 4 plugins: [ 5 new FileManagerPlugin({ 6 events: { 7 start: { 8 del: { 9 items: ['./dist'] 10 }, 11 copy: { 12 items: [ 13 { source: './src/demo', destination: './dest/demo'} 14 ], 15 options: { 16 cache: false // it would override cache of global options, so that it would run when webpack hot reload 17 } 18 }, 19 } 20 }, 21 options: { 22 parallel: 3, 23 log: 'all', 24 cache: true 25 } 26 }) 27 ] 28};
1const FileManagerPlugin = require('filemanager-plugin').WebpackFilemanager; 2 3// filemanager-plugin 1.X.X 4module.exports = { 5 plugins: [ 6 new FileManagerPlugin({ 7 start: { 8 del: [ 9 { source: './dist' } 10 ] 11 }, 12 end: { 13 zip: [ 14 { source: './src/demo', destination: './dest/demo.zip', type: 'zip'} 15 ], 16 rename: [ 17 { source: './rename/b', destination: './rename/a' } 18 ], 19 copy: [ 20 { source: './src/demo', destination: './dest/demo'} 21 ], 22 unzip: [ 23 ], 24 move: [ 25 { source: './src/demo.zip', destination: './dest/demo.zip'} 26 ] 27 } 28 }) 29 ] 30}; 31 32// filemanager-plugin 2.X.X 33module.exports = { 34 plugins: [ 35 new FileManagerPlugin({ 36 events: { 37 start: { 38 del: { 39 items: ['./dist'] 40 } 41 }, 42 end: { 43 zip: { 44 items: [ 45 { source: './src/demo', destination: './dest/demo.zip', type: 'zip'} 46 ] 47 }, 48 rename: { 49 items: [ 50 { path: './rename', oldName: 'b', newName: 'a' } 51 ] 52 }, 53 copy: { 54 items: [ 55 { source: './src/demo', destination: './dest/demo'} 56 ] 57 }, 58 unzip: { 59 items: [ 60 { source: './src/demo.zip', destination: './dest/demo', type: 'zip'} 61 ] 62 }, 63 move: { 64 items: [ 65 { source: './src/demo.zip', destination: './dest/demo.zip'} 66 ] 67 } 68 } 69 }, 70 })] 71}
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
102 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More