{"analyzedAt":"2022-11-01T08:46:09.490Z","collected":{"metadata":{"name":"rollup-plugin-license","scope":"unscoped","version":"3.0.1","description":"Rollup plugin to add license banner to the final bundle and output third party licenses","keywords":["rollup","rollup-plugin"],"date":"2022-10-31T13:51:23.315Z","author":{"name":"Mickael Jeanroy","email":"mickael.jeanroy@gmail.com","username":"mickael.jeanroy"},"publisher":{"username":"mickael.jeanroy","email":"mickael.jeanroy@gmail.com"},"maintainers":[{"username":"mickael.jeanroy","email":"mickael.jeanroy@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/mjeanroy/rollup-plugin-license.git"},"links":{"npm":"https://www.npmjs.com/package/rollup-plugin-license","homepage":"https://github.com/mjeanroy/rollup-plugin-license","repository":"https://github.com/mjeanroy/rollup-plugin-license","bugs":"https://github.com/mjeanroy/rollup-plugin-license/issues"},"license":"MIT","dependencies":{"commenting":"~1.1.0","glob":"~7.2.0","lodash":"~4.17.21","magic-string":"~0.26.2","mkdirp":"~1.0.4","moment":"~2.29.3","package-name-regex":"~2.0.6","spdx-expression-validate":"~2.0.0","spdx-satisfies":"~5.0.1"},"devDependencies":{"@babel/core":"7.19.6","@babel/preset-env":"7.19.4","@babel/register":"7.18.9","@rollup/plugin-babel":"6.0.2","@rollup/plugin-commonjs":"23.0.2","@rollup/plugin-node-resolve":"15.0.1","@rollup/plugin-virtual":"3.0.1","@typescript-eslint/eslint-plugin":"5.41.0","@typescript-eslint/parser":"5.41.0","babel-plugin-add-module-exports":"1.0.4","eslint":"8.26.0","eslint-config-google":"0.14.0","fancy-log":"2.0.0","fs-extra":"10.1.0","globalthis":"1.0.3","gulp":"4.0.2","gulp-bump":"3.2.0","gulp-conventional-changelog":"2.0.35","gulp-eslint":"6.0.0","gulp-git":"2.10.1","gulp-jasmine":"4.0.0","jasmine":"3.10.0","jasmine-core":"3.10.1","prettier":"2.7.1","rimraf":"3.0.2","rollup":"3.2.3","rollup-plugin-prettier":"3.0.0","rollup-plugin-strip-banner":"3.0.0","tmp":"0.2.1","typescript":"4.8.4"},"peerDependencies":{"rollup":"^1.0.0 || ^2.0.0 || ^3.0.0"},"releases":[{"from":"2022-10-02T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":6},{"from":"2022-08-03T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":6},{"from":"2022-05-05T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":8},{"from":"2021-11-01T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":10},{"from":"2020-11-01T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":14}],"hasTestScript":true,"readme":"# rollup-plugin-license\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/mjeanroy/rollup-plugin-license.svg)](https://greenkeeper.io/)\n[![Build Status](https://travis-ci.org/mjeanroy/rollup-plugin-license.svg?branch=master)](https://travis-ci.org/mjeanroy/rollup-plugin-license)\n[![Npm version](https://badge.fury.io/js/rollup-plugin-license.svg)](https://badge.fury.io/js/rollup-plugin-license)\n\nRollup plugin that can be used to:\n- Prepend a banner from a file.\n- Create a file containing all third-parties used in the bundle (and display the license of each dependency).\n\n## How to use\n\nInstall the plugin with NPM:\n\n```npm install --save-dev rollup-plugin-license```\n\nThen add it to your rollup configuration:\n\n```javascript\nconst path = require('path');\nconst license = require('rollup-plugin-license');\n\nmodule.exports = {\n  plugins: [\n    license({\n      sourcemap: true,\n      cwd: process.cwd(), // The default\n\n      banner: {\n        commentStyle: 'regular', // The default\n\n        content: {\n          file: path.join(__dirname, 'LICENSE'),\n          encoding: 'utf-8', // Default is utf-8\n        },\n\n        // Optional, may be an object or a function returning an object.\n        data() {\n          return {\n            foo: 'foo',\n          };\n        },\n      },\n\n      thirdParty: {\n        includePrivate: true, // Default is false.\n        output: {\n          file: path.join(__dirname, 'dist', 'dependencies.txt'),\n          encoding: 'utf-8', // Default is utf-8.\n        },\n      },\n    }),\n  ],\n}\n```\n\n## Banner\n\n### Banner file\n\nThe banner file can be a text file and it will be converted to a block comment automatically if needed.\n\nNote that the content will be translated to a lodash template with the following data model:\n- `pkg`: The content of the project `package.json`.\n- `dependencies`: An array of all the dependencies included in the bundle.\n- `moment`: The `moment` object.\n- `_`: The lodash object.\n- `data` A custom data object, defined in banner options.\n\nHere is a valid banner:\n\n```text\nBundle of <%= pkg.name %>\nGenerated: <%= moment().format('YYYY-MM-DD') %>\nVersion: <%= pkg.version %>\nDependencies:\n<% _.forEach(dependencies, function (dependency) { %>\n  <%= dependency.name %> -- <%= dependency.version %>\n<% }) %>\n```\n\n### Comment style\n\nSince version 0.10.0, it is possible to customize banner style using the `commentStyle` option:\n\n```javascript\nlicense({\n  banner: {\n    commentStyle: 'regular', // The default\n    content: {\n      file: path.join(__dirname, 'LICENSE'),\n    },\n  },\n})\n```\n\nFollowing options are available:\n\n- `regular`: \"classic\" comment block is used (this is the default), for example:\n\n```javascript\n/**\n * This is the `regular` style.\n */\n```\n\n- `ignored`: a comment block with prefix ignored by minifiers, for example:\n\n```javascript\n/*!\n * This is the `ignored` style.\n */\n```\n\n- `slash`: banner is prepended using \"slash\" comments, for example:\n\n```javascript\n//\n// This is the `slash` style.\n//\n```\n\n- `none`: nothing done, be careful to prepenbd a banner already \"commented\".\n\n### Banner as a \"simple\" string\n\nSince version 0.3.0, `banner` can be a simple string that will be used directly:\n\n```javascript\nconst license = require('rollup-plugin-license');\n\nmodule.exports = {\n  plugins: [\n    license({\n      banner: `Copyright <%= moment().format('YYYY') %>`,\n    }),\n  ],\n}\n```\n\nIf you want to add some options to banner (such as the comment style to use), and still define it as a `string` (insead of pointing to a file), you can also define the banner like this (since version `0.11.0`):\n\n```javascript\nconst license = require('rollup-plugin-license');\n\nmodule.exports = {\n  plugins: [\n    license({\n      banner: {\n        content: `Copyright <%= moment().format('YYYY') %>`,\n        commentStyle: 'ignored',\n      },\n    }),\n  ],\n}\n```\n\n### Deprecated format\n\nUntil version 0.10.0, banner file was defined as:\n\n\n```javascript\nconst path = require('path');\nconst license = require('rollup-plugin-license');\n\nmodule.exports = {\n  plugins: [\n    license({\n      banner: {\n        file: path.join(__dirname, 'LICENSE'),\n        encoding: 'utf-8',\n      },\n    }),\n  ],\n};\n```\n\nThis format has been deprecated with version 0.11.0 and removed with version 1.0.O, and the banner file should be defined inside `banner.content` entry:\n\n```javascript\nconst path = require('path');\nconst license = require('rollup-plugin-license');\n\nmodule.exports = {\n  plugins: [\n    license({\n      banner: {\n        content: {\n          file: path.join(__dirname, 'LICENSE'),\n          encoding: 'utf-8',\n        },\n      },\n    }),\n  ],\n};\n```\n\n## Dependencies output\n\nA file containing a summary of all dependencies can be generated automatically using the following options:\n\n```javascript\nlicense({\n  thirdParty: {\n    output: path.join(__dirname, 'dist', 'dependencies.txt'),\n    includePrivate: true, // Default is false.\n  },\n})\n```\n\nStarting with version `0.12.0`, you can have more control by defining `output` as an object, for example:\n\n```javascript\nlicense({\n  thirdParty: {\n    includePrivate: false,\n    output: {\n      file: path.join(__dirname, 'dist', 'dependencies.txt'), // Path of the license report\n      encoding: 'utf-8', // default is UTF-8\n\n      // Template function that can be defined to customize report output\n      template(dependencies) {\n        return dependencies.map((dependency) => `${dependency.name}:${dependency.version} -- ${dependency.license}`).join('\\n');\n      },\n    },\n  },\n})\n```\n\nNote that the template option can also be a lodash template:\n\n```javascript\nlicense({\n  thirdParty: {\n    includePrivate: false,\n    output: {\n      file: path.join(__dirname, 'dist', 'dependencies.txt'),\n\n      // Lodash template that can be defined to customize report output\n      template: `\n        <% _.forEach(dependencies, function (dependency) { %>\n          <%= dependency.name %>:<%= dependency.version%> -- <%= dependency.license %>\n        <% }) %>\n      `,\n    },\n  },\n})\n```\n\nFor example, it can be relatively easy to produce a JSON output instead of a text file:\n\n```javascript\nlicense({\n  thirdParty: {\n    includePrivate: false,\n    output: {\n      file: path.join(__dirname, 'dist', 'dependencies.json'),\n      template(dependencies) {\n        return JSON.stringify(dependencies);\n      }\n    },\n  },\n})\n```\n\n## License Checks\n\nStarting with version 0.13, it is possible to ensure that dependencies does not violate any license restriction.\nFor example, suppose you want to limit dependencies with MIT or Apache-2.0 licenses, simply define the restriction such as:\n\n```javascript\nlicense({\n  thirdParty: {\n    allow: '(MIT OR Apache-2.0)',\n  },\n})\n```\n\nNote that the `allow` value here should be a valid SPDX pattern (more information [here](https://www.npmjs.com/package/spdx-expression-validate)).\n\nThe `allow` option here will print a warning to the console for all license violation. Note that, if you want more control, it can also be defined as function:\n\n```javascript\nlicense({\n  thirdParty: {\n    allow(dependency) {\n      return dependency.license === 'MIT';\n    },\n  },\n})\n```\n\nThe function defined here allow only MIT licenses, and will print a warning for anything else.\n\nFinally, if emitting a warning is not enought for you, you can also choose to fail the build:\n\n```javascript\nlicense({\n  thirdParty: {\n    allow: {\n      test: 'MIT',             // Or a function that should returns `true` or `false`\n      failOnUnlicensed: true,  // Fail if a dependency does not specify any licenses, default is `false`\n      failOnViolation: true,   // Fail if a dependency specify a license that does not match given requirement, default is `false`\n    },\n  },\n})\n```\n\n## Changelogs\n\n- 2.8.0\n  - Relax production dependency versions ([#1128]()https://github.com/mjeanroy/rollup-plugin-license/issues/1128)\n  - Update dependencies\n- 2.7.0\n  - Update dependencies ([#1077](https://github.com/mjeanroy/rollup-plugin-license/issues/1077))\n- 2.6.0\n  - Improve case insensitive search ([PR](https://github.com/mjeanroy/rollup-plugin-license/pull/931)), thanks [@codepunkt](https://github.com/codepunkt)!\n  - Search for `LICENCE` or `LICENSE` files ([PR](https://github.com/mjeanroy/rollup-plugin-license/pull/931)), thanks [@codepunkt](https://github.com/codepunkt)!\n- 2.5.0\n  - Look for dependencies' license files case insensitively, thanks [@Luke-zhang-04](https://github.com/Luke-zhang-04)!\n- 2.4.0\n  - Typings added\n  - Update dependencies\n- 2.0.0\n  - Support node >= 10\n  - Update dependencies\n- 1.0.0\n  - Remove support for rollup < 1.0.0\n  - Remove support for deprecated options.\n  - Support node >= 6\n- 0.14.0\n  - Update rollup peer dependency\n  - Produce a single file as dist output\n  - Update dependencies\n- 0.13.0\n  - Add license checking (see [#381](https://github.com/mjeanroy/rollup-plugin-license/issues/381)).\n- 0.12.1\n  - Restore compatibility with Node6\n- 0.12.0\n  - Improve `output` configuration (see [#379](https://github.com/mjeanroy/rollup-plugin-license/issues/379)).\n  - Improve option object validation and warning.\n  - Deprecate `thirdParty.encoding` option.\n  - Dev dependencies updates.\n- 0.11.0\n  - Fail if the banner file does not exist (breaking change).\n  - Deprecate `banner.file` / `banner.encoding` entries, use `banner.content.file` / `banner.content.encoding` instead (see [#428](https://github.com/mjeanroy/rollup-plugin-license/issues/428)).\n  - Allow comment style to be defined with a \"string\" banner (see [#308](https://github.com/mjeanroy/rollup-plugin-license/issues/308) and [#428](https://github.com/mjeanroy/rollup-plugin-license/issues/428)).\n  - Dev dependencies updates.\n- 0.10.0\n  - Support different comment style for banner (see [#308](https://github.com/mjeanroy/rollup-plugin-license/issues/308)).\n  - Do not include tree shaken dependencies (see [#380](https://github.com/mjeanroy/rollup-plugin-license/issues/380))\n  - Various dependency updates.\n- 0.9.0\n  - Fix for `NULL` character (see [#1](https://github.com/mjeanroy/rollup-plugin-license/issues/1)).\n  - Various dependency updates.\n- 0.8.1\n  - Add rollup as a peer dependency.\n- 0.8.0\n  - Deprecate `sourceMap` option (use `sourcemap` option in lowercase) to keep it consistent with rollup.\n  - Fix deprecate call with rollup >= 1, keep compatibility with legacy versions of rollup.\n  - Upgrade dependencies.\n- 0.7.0\n  - Add a way to specify custom data object when rendering banner.\n  - Add `cwd` option to specify custom working directory (optional option).\n  - Upgrade dependencies.\n- 0.6.0\n  - Upgrade `commenting` dependency.\n- 0.5.0\n  - Feat: Sourcemap is now enable by default to ensure compatibility with other rollup plugins.\n  - Fix: Add compatibility with rollup >= 0.48.0 (the new `sourcemap` option).\n  - Fix: Ensure plugin `sourcemp` is used instead of the \"global\" one in rollup options.\n  - Chore: dependency updates.\n- 0.4.0\n  - Dependency update (`moment`).\n  - Dependency update (`magic-string`).\n- 0.3.0\n  - Add encoding option for banner and third-party output file.\n  - Banner can be a simple string.\n\n## License\n\nMIT License (MIT)\n\n## Contributing\n\nIf you find a bug or think about enhancement, feel free to contribute and submit an issue or a pull request."},"npm":{"downloads":[{"from":"2022-10-31T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":4322},{"from":"2022-10-25T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":31530},{"from":"2022-10-02T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":129471},{"from":"2022-08-03T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":282566},{"from":"2022-05-05T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":476096},{"from":"2021-11-01T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":802356}],"starsCount":0},"github":{"starsCount":77,"forksCount":15,"subscribersCount":2,"issues":{"count":1265,"openCount":5,"distribution":{"3600":106,"10800":85,"32400":178,"97200":331,"291600":313,"874800":194,"2624400":39,"7873200":12,"23619600":5,"70858800":0,"212576400":2},"isDisabled":false},"contributors":[{"username":"greenkeeper[bot]","commitsCount":469},{"username":"dependabot[bot]","commitsCount":381},{"username":"mjeanroy","commitsCount":316},{"username":"dependabot-preview[bot]","commitsCount":189},{"username":"Luke-zhang-04","commitsCount":2},{"username":"gregod","commitsCount":1},{"username":"slavafomin","commitsCount":1},{"username":"codepunkt","commitsCount":1},{"username":"dnalborczyk","commitsCount":1},{"username":"DesselBane","commitsCount":1},{"username":"roydukkey","commitsCount":1},{"username":"mfranzke","commitsCount":1},{"username":"MichaelKowal","commitsCount":1}],"commits":[{"from":"2022-10-25T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":5},{"from":"2022-10-02T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":46},{"from":"2022-08-03T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":79},{"from":"2022-05-05T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":148},{"from":"2021-11-01T00:00:00.000Z","to":"2022-11-01T00:00:00.000Z","count":292}]},"source":{"files":{"readmeSize":11214,"testsSize":110494,"hasNpmIgnore":true,"hasChangelog":true},"badges":[{"urls":{"original":"https://travis-ci.org/mjeanroy/rollup-plugin-license.svg?branch=master","service":"https://api.travis-ci.org/mjeanroy/rollup-plugin-license.svg?branch=master","shields":"https://img.shields.io/travis/mjeanroy/rollup-plugin-license/master.svg","content":"https://img.shields.io/travis/mjeanroy/rollup-plugin-license/master.json"},"info":{"service":"travis","type":"build","modifiers":{"branch":"master"}}}],"linters":["editorconfig","eslint","prettier"],"outdatedDependencies":{"glob":{"required":"~7.2.0","stable":"8.0.3","latest":"7.2.3"}}}},"evaluation":{"quality":{"carefulness":0.9999999999999999,"tests":0.6,"health":0.7777777777777778,"branding":0.15},"popularity":{"communityInterest":107,"downloadsCount":94188.66666666667,"downloadsAcceleration":641.0516362252662,"dependentsCount":0},"maintenance":{"releasesFrequency":1,"commitsFrequency":1,"openIssues":1,"issuesDistribution":1}},"score":{"final":0.6868078474516672,"detail":{"quality":0.9267395552357515,"popularity":0.16795994537411932,"maintenance":1}}}