write-file-webpack weekly downloads statistics
By Gyumeijie (2 listings) · npm · Webpack plugins
[](https://opensource.org/licenses/MIT)
write-file-webpack has 8 recorded weekly downloads on npm, a decrease of 52.9% over the past 30 days, ranking #3177 of 3,247 tracked listings.
About write-file-webpack
Write to file plugin for webpack(v3)
This is a simple webpack plugin for writing data to file. And there is a similar plugin for webpack v4.
Features
- support creating directory recursively
- support data of function type, which allows processing data in complex situation
- support native options of underlying writeFileSync
- support protection of an exsited file
Installation
npm install --save-dev write-file-webpack
Usage
The data to be written can be either a simple javascript variable, or a function which returns some data.
const WriteToFilePlugin = require('write-file-webpack');
module.exports = {
...
plugins: [
new WriteToFilePlugin({
filename: 'path/to/write/file',
data: 'console.log("write to file")'
})
]
...
}
const WriteToFilePlugin = require('write-file-webpack');
module.exports = {
...
plugins: [
new WriteToFilePlugin({
filename: 'path/to/write/file',
data: function () {
return "console.log('write to file')"
}
})
]
...
}
If the data is provided as a function, we can do more operations than just simply returning the data to be written. For example, if we wanna write to a file parts of an exsited file say package.json, and more specifically, removing the dependencies and devDependencies items, with write-file-webpack we can do this:
const WriteToFilePlugin = require('write-file-webpack');
const config = require('./package.json');
module.exports = {
...
plugins: [
new WriteToFilePlugin({
filename: 'path/to/write/package.json',
data: function () {
return JSON.stringify({
...config,
dependencies: undefined,
devDependencies: undefined,
});
}
})
]
...
}
Of course, if we want to copy the whole content of a existed file, there is webpack plugin called copy-webpack-plugin.
Support
node >= 6 and webpack v3
Options
- filename (required)
- data (required)
- override
<boolean> Default: true, if set to false, no data will be written to an exsited file - encoding
<string> | <null> Default: 'utf8' - mode
<integer> Default: 0o666 - flag
<string> Default: 'w'
For more information about encoding, mode, and flag please refer to node writeFile.
Description from the npm listing.
- webpack
- webpack v3
- write
- file
- plugin
- webpack-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (592)Similar npm Webpack plugins plugins
All 20 write-file-webpack alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/write-file-webpack. First seen Oct 16, 2026; last successful collection Oct 28, 2026. See the methodology.