Registry / testing / vue-unused-components-checker

vue-unused-components-checker

JSON →
library1.1.2jsnpmunverified

A CLI tool to detect unused `.vue` components in Vue.js projects. Version 1.1.2 (latest as of May 2021) scans the file tree for `.vue` files and checks if they are imported and used anywhere. It supports limiting open files for large directories and ignoring glob patterns (e.g., node_modules). The tool is simple, focused, and works with Vue 2 projects. It is not actively maintained (no releases since 2021). Alternatives like `eslint-plugin-vue` with `no-unused-components` provide deeper analysis.

npm install vue-unused-components-checker
INSTALL
IMPORT
SIG · VUE-UNUSED-COMPONE
V
vue-unused-components-checker
testingjavascriptv1.1.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

checkUnusedComponents
import { checkUnusedComponents } from 'vue-unused-components-checker'
const checkUnusedComponents = require('vue-unused-components-checker')
Package is ESM-only. CommonJS require will fail.

Programmatic usage that scans src/ directory for unused .vue components and logs the list.

import { checkUnusedComponents } from 'vue-unused-components-checker'; const path = require('path'); const results = checkUnusedComponents({ rootDir: path.resolve('./src'), ignorePatterns: ['**/node_modules/**'], maxOpenFiles: 50 }); console.log(results.unused);
vue-unused-components-checker --version
Debug
Known issues
gotchaCLI command is 'check-unused-comp', not 'vue-unused-components-checker'
fix
Run `check-unused-comp .` instead of trying to run the package name directly.
affects: >=1.0
breakingCommonJS require does not work; package is ESM-only
fix
Use `import` syntax or set `"type": "module"` in your package.json.
affects: >=1.0
deprecatedNo updates since 2021; consider migrating to eslint-plugin-vue with no-unused-components rule
fix
Switch to eslint-plugin-vue for better maintenance and integration.
affects: >=1.0
gotchaMax open files option is -o but takes a number without flag name, e.g., -o 20
fix
Use `-o 20` (no equals sign) to limit open files.
affects: >=1.0
Errors
Common errors & fixes
Error: Cannot find module 'vue-unused-components-checker'
CLI command called incorrectly; package might be installed globally but command name is different.
fix
Use `check-unused-comp .` instead of `vue-unused-components-checker .`
Error [ERR_REQUIRE_ESM]: require() of ES Module
Using CommonJS require on an ESM-only package.
fix
Use `import { checkUnusedComponents } from 'vue-unused-components-checker'` or convert project to ESM.
ENAMETOOLONG: name too long
File paths too long when scanning large directories with many nested folders.
fix
Use `-o 20` to limit open files and avoid hitting the OS path length limit.
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies
globrequiredFor file pattern matching
Agent activity
14 hits · last 30 days
node
10
Resources
vue-unused-components-checker — npm install vue-unused-components-checker · libregistry