browserify-plugin-license-notice
Extract third-party licenses to a file.
Last updated 3 months ago by codeclown .
MIT · Original npm · Tarball · package.json
$ cnpm install browserify-plugin-license-notice 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.2                                ...           latest (3 months ago)

3 Versions

  • 1.0.2                                ...           3 months ago
  • 1.0.1                                ...           3 months ago
  • 1.0.0                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |