primus-webpack-plugin weekly downloads statistics
By kkemple · npm · Webpack plugins
Build client side primus script and add to build assets
primus-webpack-plugin has 6 recorded weekly downloads on npm, a decrease of 81.3% over the past 30 days, ranking #3212 of 3,247 tracked listings.
About primus-webpack-plugin
PrimusWebpackPlugin
Build client side Primus script and add to build assets 📦⚡
Introduction
Primus is a socket wrapper implementation that requires a built client library. The client library also needs to match the configuration of the server side implementation. Primus handles this by exposing primus.library() which returns the client library as a string.
This is problematic in applications that bundle and dynamically generate client assets. It is also problematic because unless you want to serve the client script directly from your websocket server (not a great approach IMO) you need to prebuild and package the client script anyway.
This plugin allows you to pass in your Primus options and then adds the client library to your Webpack build assets.
If HtmlWebpackPlugin is being used it will also add the asset to the output HTML :tada:
Usage
Install PrimusWebpackPlugin:
npm install --save-dev primus-webpack-plugin
With Yarn:
yarn add -D primus-webpack-plugin
In webpack.config.js:
const PrimusWebpackPlugin = require('primus-webpack-plugin')
...
new PrimusWebpackPlugin({
filename: 'primus-client.[hash].js',
minify: true,
primusOptions: {
transformer: 'uws',
parser: {
encoder: function (data, fn) {
fn(null, JSON.stringify(data))
},
decoder: function (data, fn) {
fn(null, JSON.parse(data))
}
}
}
})
Options:
| Name | Description | Default |
|---|---|---|
| filename | Name of generated file | primus-client.js |
| minify | Whether or not to minify the file | false |
| primusOptions | Options for the Primus Server | {} |
Caveats
primus.library() generates a UMDish style file but it doesn't seem to work being bundled with Webpack, instead a global Primus constructor is added. If you want to require/import Primus you will need to shim it in your Webpack config.
Description from the npm listing.
- webpack-plugin
- webpack
- primus
- sockets
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 primus-webpack-plugin 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/primus-webpack-plugin. First seen Oct 16, 2026; last successful collection Dec 1, 2026. See the methodology.