Coder Social home page Coder Social logo

browserify-plugin-license-notice's Introduction

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 ([email protected])

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

browserify-plugin-license-notice's People

Contributors

codeclown avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.