Skip to content
PluginStats

strip-console weekly downloads statistics

By i-m-anurag · npm · Webpack plugins

Strip console.* calls from JavaScript and TypeScript code

View on npm Outdated · Nov 8, 2026

strip-console has 21 recorded weekly downloads on npm, a decrease of 4.5% over the past 30 days, ranking #2981 of 3,247 tracked listings.

Weekly downloads
21
Official API · Dec 5, 2026
7-day growth
+90.9%
+10 weekly downloads
30-day growth
-4.5%
-1 weekly downloads
90-day growth
—
Insufficient history
Rank
#2981
▼ 39 in 7 days

About strip-console

strip-console

Strip console.* calls and debugger statements from JavaScript and TypeScript code, without breaking the code around them.

// before
console.log('user', user);
console.log(i++);
const done = () => console.log('done');
console.warn('slow');

// after
i++;
const done = () => void 0;
console.warn('slow');
  • Works as a plugin for Vite, Rollup, Rolldown, webpack, Rspack and esbuild.
  • Ships a CLI that rewrites a build folder in place, or audits it in CI.
  • Keeps arguments with side effects, keeps console.warn and console.error by default, and produces source maps.

Contents

Install

npm install --save-dev strip-console

Requires Node.js 22.12 or newer.

Bundler plugin

Every entry exports one function that takes the options below.

Vite
// vite.config.js
import { defineConfig } from 'vite';
import stripConsole from 'strip-console/vite';

export default defineConfig({
  plugins: [stripConsole()],
});

The Vite plugin only runs during vite build, so console.log still works in the dev server.

Rollup
// rollup.config.js
import stripConsole from 'strip-console/rollup';

export default {
  input: 'src/index.js',
  output: { dir: 'dist' },
  plugins: [stripConsole()],
};
Rolldown
// rolldown.config.js
import stripConsole from 'strip-console/rolldown';

export default {
  input: 'src/index.js',
  plugins: [stripConsole()],
};
webpack
// webpack.config.js
const stripConsole = require('strip-console/webpack');

module.exports = (env, argv) => ({
  entry: './src/index.js',
  plugins: argv.mode === 'production' ? [stripConsole()] : [],
});
Rspack
// rspack.config.js
const stripConsole = require('strip-console/rspack');

module.exports = (env, argv) => ({
  entry: './src/index.js',
  plugins: argv.mode === 'production' ? [stripConsole()] : [],
});

The webpack and Rspack plugins run in every mode, so add them only to production builds as shown.

esbuild
// build.mjs
import { build } from 'esbuild';
import stripConsole from 'strip-console/esbuild';

await build({
  entryPoints: ['src/index.js'],
  bundle: true,
  outdir: 'dist',
  plugins: [stripConsole()],
});
Plugin-only options
OptionDefaultMeaning
includeJS, TS, JSX, TSX, .vue, .svelte, .astroModules to process
excludenode_modulesModules to skip
chunksfalseAlso process the final output chunks (Vite, Rollup and Rolldown only)
runtimeGuardfalseAdd a runtime stub that silences the removed methods (see below)

By default the plugin skips node_modules. Set chunks: true to also clean the bundled output, which catches console calls in dependencies and in compiled framework files. Files that fail to parse are skipped with a warning instead of failing the build.

Runtime guard

Static removal cannot see calls whose method name is only known at runtime, such as console[level](message). With runtimeGuard: true, the plugin adds a small script to the top of each entry chunk that replaces the listed methods with empty functions:

stripConsole({ runtimeGuard: true });

The guard silences every call to those methods, including ones kept with a /* keep */ comment, and leaves console.warn and console.error alone unless you list them. It works with every bundler above. For other setups, createRuntimeGuard(methods) from strip-console returns the script as a string, ready to inline at the top of your entry file.

CLI

The CLI works on files that are already built, so it fits any toolchain, including ones without a plugin hook.

npx strip-console dist/            # rewrite .js/.mjs/.cjs files in place
npx strip-console dist/ --dry-run  # show what would change without writing
npx strip-console audit dist/      # list remaining calls; exits 1 if any are found
npx strip-console audit dist/ --json

With no folder given, both commands use dist. When a file has a .map next to it, the rewrite updates the map so it still points at your original sources.

FlagMeaning
--methods <list>Console methods to remove, such as log,debug
--loggers <list>Extra callees to remove, such as logger.debug
--keep-comment <text>Comment text that keeps the next call
--no-debuggerKeep debugger statements
--include <glob>Files to process (default **/*.{js,mjs,cjs})
--exclude <glob>Files to skip (default **/node_modules/**)
--config <file>Read settings from this file
--jsonPrint a machine-readable report
--dry-runRewrite command only: report without writing
Config file

Settings can live in strip-console.config.json, strip-console.config.mjs, strip-console.config.js, or a "stripConsole" key in package.json. Flags override the file.

{
  "dirs": ["dist", "build/public"],
  "methods": ["log", "debug", "info", "trace"],
  "loggers": ["logger.debug"],
  "exclude": ["**/vendor/**"]
}

Audit in CI

strip-console audit exits with code 1 when any console call is left, so it can guard a build even if you never rewrite files.

# .github/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npm ci
      - run: npm run build
      - run: npx strip-console audit dist/

A failing run prints one line per call, so the log shows exactly where to look:…

Description from the npm listing.

  • build
  • console
  • console.log
  • esbuild-plugin
  • remove
  • rollup-plugin
  • strip
  • unplugin
  • vite-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

strip-console weekly downloads on npm, last 90 days: 21 weekly downloads as of Dec 5, 2026.strip-consoleWeekly downloads on npm · Last 90 days21downloads / week02004006008001KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
strip-console weekly downloads on npm, last 90 days: 21 weekly downloads as of Dec 5, 2026.

7/30/90-day growth

strip-console weekly downloads growth on npm: +90.9% over 7 days, -4.5% over 30 days, 90-day growth unavailable.strip-consoleWeekly downloads growth on npm21downloads / week now7-day growth+10 weekly downloads+90.9%30-day growth-1 weekly downloads-4.5%90-day growth+21 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
strip-console weekly downloads growth on npm: +90.9% over 7 days, -4.5% over 30 days, 90-day growth unavailable.

Ranking history

strip-console npm ranking history: currently #2981 (by weekly downloads).strip-consolenpm ranking · by weekly downloads · Last 90 days#2981current rank#1800#2000#2200#2400#2600#2800#3000Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 28 observations · Updated Dec 5, 2026pluginstats.com
strip-console npm ranking history: currently #2981 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 150, #3 (overall #2,983)
All npm: every listing in weekly downloads order

Listing placement

Webpack plugins349 listings · 18 pages · page 15, #17 (overall #297)
Webpack plugins: every listing in weekly downloads order

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 (170)
Recent weekly downloads observations for strip-console
Date (UTC)Weekly downloadsChange vs. previous
21-4
25+6
19+12
70
7-1
8-4
12+1
110
11+1
10-6
16-2
18-2
20+4
16—

Similar npm Webpack plugins plugins

All 20 strip-console alternatives

Data 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/strip-console. First seen Oct 16, 2026; last successful collection Nov 8, 2026. See the methodology.