Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@transmission-dynamics/esbuild-plugin-license
Advanced tools
Manage third-party license compliance in your esbuild
License generation tool similar to https://github.com/mjeanroy/rollup-plugin-license
npm i -D @transmission-dynamics/esbuild-plugin-license
import * as esbuild from 'esbuild'
import esbuildPluginLicense from 'esbuild-plugin-license';
esbuild.build({
entryPoints: ['index.ts'],
outdir: 'dist',
plugins: [esbuildPluginLicense()],
bundle: true,
platform: 'node'
})
The available options are:
Name | Description |
---|---|
additionalFiles | Default: {} . An object that defines additional files to be generated by the plugin based on its default output (e.g., an HTML representation of the licenses in addition to the generated JSON). The keys represent filenames, while the values are functions invoked with the packages array and return the content to be written to the additional file. These functions can return a string or a Promise<string> . |
excludedPackageTest | A function used to exclude specific packages from the process. It is invoked with the packageName (string) of each package and should return true to exclude the package from the output. |
file | Default: oss-licenses.json . Specifies the path to the output file that will be generated. The path is relative to the bundle output directory. |
unacceptableLicenseTest | A function that defines unacceptable license identifiers. It is invoked with the license (string) of each package and should return true when the license is considered unacceptable, causing the build to fail. |
includePrivate | A boolean that determines whether private packages should be included in the output. |
template | A function that customizes the generated file content. It accepts the packages array as an argument and should return the generated file content as a string . |
banner | A string banner inserted at the beginning of the bundled file. Supports Lodash template format for dynamic content generation. |
Example of default config
export const defaultOptions: DeepRequired<Options> = {
banner: `/*! <%= pkg.name %> v<%= pkg.version %> | <%= pkg.license %> */`,
thirdParty: {
includePrivate: false,
excludedPackageTest: (packageName) => false,
additionalFiles: {},
unacceptableLicenseTest: (license) => false,
output: {
file: 'oss-licenses.json',
// Template function that can be defined to customize report output
template(dependencies) {
// Default template function
},
}
}
} as const
pnpm
with major version 7: npm install -g pnpm@7
pnpm install --frozen-lockfile
pnpm run build
pnpm run dev
pnpm run test
FAQs
Manage third-party license compliance in your esbuild
We found that @transmission-dynamics/esbuild-plugin-license 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.