Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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.
The npm package next-unused receives a total of 28,233 weekly downloads. As such, next-unused popularity was classified as popular.
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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.