
Security News
New CNAPulse Dashboard Tracks CNA Activity and Disclosure Trends
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.
next-unused
Advanced tools
next-unused is an easy way to find unused files in your [Next.js](https://github.com/zeit/next.js) project.
next-unused is an easy way to find unused files in your Next.js project.
Make sure you install as a devDependency, otherwise you will add 60mb+ to your build.
$ yarn add next-unused -D
In package.json, add a script to find unused files:
"scripts": {
"find:unused": "next-unused"
}
Run the script to list any unused files: yarn find:unused.
Add a property to your package.json to configure next-unused:
{
"next-unused": {
"alias": {},
"include": [],
"exclude": [],
"entrypoints": []
}
}
| Property | Type | Default | Description |
|---|---|---|---|
debug | boolean | false | turn on debug messages |
alias | object | {} | import aliases in webpack format ({ "@components": "components/" }) |
include | string[] | ['pages'] | list of directories to search through. pages is always included |
exclude | string[] | [] | array of RegExp that exclude matching filenames |
entrypoints | string[] | ['pages'] | list of directories to use as entrypoints. pages is always included |
Your Next.js setup looks like this:
package.json
├─ pages/
│ ├─ index.js
└─ components/
├─ button.js
└─ image.js
And your pages/index.js contains:
import Button from '../components/button'
export default () => {
return (
<Button>Click me</Button>
)
}
Configure next-unused to include the components directory in package.json:
{
"next-unused": {
"include": ["components"]
}
}
Running next-unused will output:
Found 1 unused file:
components/image.js
Shu and Luc wrote the initial version of this script.
FAQs
next-unused is an easy way to find unused files in your [Next.js](https://github.com/zeit/next.js) project.
We found that next-unused demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.

Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.