New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

browserify-plugin-license-notice

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserify-plugin-license-notice

Extract third-party licenses to a file.

1.0.2
latest
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

browserify-plugin-license-notice

Extract third-party licenses to a file. Two options:

  • use the plugin during the build process
    browserify --plugin browserify-plugin-license-notice
  • run the CLI tool against an already generated bundle
    browserify-bundle-license-notice dist/bundle.js

Format of the generated file:

Package: @babel/runtime
Source: https://npmjs.com/package/@babel/runtime
License: MIT

MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, [... shortened ...]

-----

Package: capital-case
Source: https://npmjs.com/package/capital-case
License: MIT

The MIT License (MIT)

Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)

Permission is hereby granted, [... shortened ...]

-----

Installation

npm install --save-dev browserify-plugin-license-notice
yarn add --dev browserify-plugin-license-notice

Usage

Command Line

By default will write into file THIRD_PARTY_LICENSES.

browserify -p browserify-plugin-license-notice

Filename can be configured.

browserify -p [ browserify-plugin-license-notice --out licenses.txt ]

Also supported "CI mode", where the script will throw an error if a difference is detected to already existing file.

browserify -p [ browserify-plugin-license-notice --check ]

Stand-alone CLI utility

Also included is a CLI utility which generates a license notice from an already bundled file.

browserify-bundle-license-notice dist/bundle.js > THIRD_PARTY_LICENSES

It also supports "CI mode", which fails if the existing file is out-dated.

browserify-bundle-license-notice dist/bundle.js --check THIRD_PARTY_LICENSES

Browserify API

Use the plugin programmatically like this:

const browserify = require('browserify');
const licenseNotice = require('browserify-plugin-license-notice');

browserify({ debug: true })
  .plugin(licenseNotice, {
    // configuration as usual
  })
  .bundle()
  .pipe(fs.createWriteStream('bundle.js', 'utf8'));

Options

out (string)

Path of the file to write.

check (boolean)

If true, the plugin will throw if a difference is detected between the output and an already existing file. Use this as a CI step to ensure that the licenses file is up-to-date in your version control.

License

MIT

Keywords

browserify

FAQs

Package last updated on 15 Oct 2020

Did you know?

Socket

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.

Install

Related posts