Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@rushstack/webpack-embedded-dependencies-plugin
Advanced tools
This plugin analyzes bundled dependencies from Node Modules for use with Component Governance and License Scanning.
npm install @rushstack/webpack-embedded-dependencies-plugin --save
A webpack plugin for generating a list of embedded dependencies. Embedded dependencies are third-party packages which are being bundled into your released code and are oftentimes subject to license, security, and other legal requirements. This plugin aims to make it easier to generate a list of embedded dependencies and their associated metadata, so they can be analyzed by additional tools.
The plugin also includes the ability to generate a secondary asset which contains the license text for each embedded dependency into a single file called THIRD-PARTY-NOTICES.html. This is a common legal requirement when deploying services or products containing open-source code.
// webpack.config.js
import EmbeddedDependenciesWebpackPlugin from '@rushstack/webpack-embedded-dependencies-plugin';
export default () => {
/*...*/
plugins: [
new EmbeddedDependenciesWebpackPlugin( /* options */ )
]
}
outputFileName
: string
Name of the file to be generated. Defaults to embedded-dependencies.json
new EmbeddedDependenciesWebpackPlugin({
outputFileName: 'my-custom-file-name.json'
})
generateLicenseFile
: boolean
Whether to generate a license file. Defaults to false and will only generate the embedded-dependencies.json file
new EmbeddedDependenciesWebpackPlugin({
generateLicenseFile: true
})
generateLicenseFileFunction
: LicenseFileGeneratorFunction
Function that generates the license file. Defaults to the plugin's internal default generator function but allows you to override it.
new EmbeddedDependenciesWebpackPlugin({
generateLicenseFile: true,
generateLicenseFileFunction: (packages: IPackageData[]): string => {
return packages
.map((pkg) => {
return `<h2>${pkg.name}</h2><p>${pkg.license}</p>`;
}).join('');
}
})
generatedLicenseFilename
: LicenseFileName
new EmbeddedDependenciesWebpackPlugin({
generateLicenseFile: true,
generatedLicenseFilename: 'custom-license-file-name.html'
})
Name of the generated license file. Defaults to THIRD-PARTY-NOTICES.html but can be customized to any name you want.
packageFilterPredicate
: (packageJson: IPackageData, filePath: string) => boolean
Function that allows you to filter out packages that you don't want to include in any generated files.
new EmbeddedDependenciesWebpackPlugin({
packageFilterPredicate: (packageJson: IPackageData, filePath: string): boolean => {
return packageJson.name !== 'my-package-to-exclude';
}
})
LicenseFileGeneratorFunction
export declare type LicenseFileGeneratorFunction = (packages: IPackageData[]) => string;
Function type that generates the license file.
const licenseFileGenerator: LicenseFileGeneratorFunction = (packages: IPackageData[]): string => {
return packages
.map((pkg) => {
return `<h2>${pkg.name}</h2><p>${pkg.license}</p>`;
}).join('');
}
LicenseFileName
export declare type LicenseFileName = `${string}.${'html' | 'md' | 'txt'}`;
Loose string type that represents the name of the generated license file. The string must have at least one character and must end with one of the following file extensions: html, md, or txt or else you'll receive a TypeScript error.
const licenseFileName: LicenseFileName = 'custom-license-file-name.html';
const licenseMarkdownFileName: LicenseFileName = 'custom-license-file-name.md';
const licenseTextFileName: LicenseFileName = 'custom-license-file-name.txt';
@rushstack/webpack-embedded-dependencies-plugin
is part of the Rush Stack family of projects.
FAQs
This plugin analyzes bundled dependencies from Node Modules for use with Component Governance and License Scanning.
The npm package @rushstack/webpack-embedded-dependencies-plugin receives a total of 7 weekly downloads. As such, @rushstack/webpack-embedded-dependencies-plugin popularity was classified as not popular.
We found that @rushstack/webpack-embedded-dependencies-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.