# rollup-plugin-license-xml

> Generates a xml with the licenses of your runtime dependencies

Latest version **0.0.4** (published 2020-05-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-license-xml
pnpm add rollup-plugin-license-xml
yarn add rollup-plugin-license-xml
bun add rollup-plugin-license-xml
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2020-05-20 |
| First published | 2020-05-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8.0.0 |
| Dependencies | 1 |
| Unpacked size | 15.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Erik Jan de Wit |
| Maintainers | edewit |
| Keywords | rollup, plugin, config, import, bundle, analysis, license |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-license-xml
- Repository: https://github.com/edewit/rollup-plugin-license
- Homepage: https://github.com/edewit/rollup-plugin-license/
- Issues: https://github.com/edewit/rollup-plugin-license/issues
- npm.io page: https://npm.io/package/rollup-plugin-license-xml

## Dependencies (1)

- [handlebars](https://npm.io/package/handlebars.md) ^4.7.6

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2020-05-20
- 0.0.3 — 2020-05-20
- 0.0.2 — 2020-05-20
- 0.0.1 — 2020-05-20

## README

# rollup-plugin-license-xml [![NPM version](https://badge.fury.io/js/rollup-plugin-license-xml.svg)](https://npmjs.org/package/rollup-plugin-license-xml)

## rollup-plugin-license-xml

Creates a license.xml file from all your dependencies see [template](template.handlebars)

## Install

```sh
$ npm install --save-dev rollup-plugin-license-xml
```

## Usage

### Importing or Requiring

#### Import as ES Module
```js
import license from 'rollup-plugin-license-xml'
```

#### Requiring as CJS
```js
const license = require('rollup-plugin-license-xml')
```

### Usage from rollup config
```js
export default {
  entry: 'module.js',
  dest: 'index.js',
  format: 'cjs',
  plugins: [license()]
}
```

### Usage from build script
```js
rollup({
  entry: 'main.js',
  plugins: [license()]
}).then(...)
```

### results
logged to console on rollup completion
```xml
<other>
    <description>rollup-plugin-license-xml</description>
    <locations>
        <file>/test/_fixtures/bundle-a.js</file>
    </locations>
    <licenses>
    <license>
        <name>MIT</name>
        <url>https://raw.githubusercontent.com/edewit/rollup-plugin-license/master/LICENSE</url>
    </license>
    </licenses>
</other>
<other>
  ...
```

## Options

- **root** - *optional*
  - type: String
  - default: `process.cwd()`
  - description: Application directory, used to display file paths relatively
- **writeTo** - *optional*
  - type: Function
  - default: `null`
  - description: Callback to be invoked with formatted string
  - function will be invoked with:
    - **analysisString** *(String)*
- **onAnalysis** - *optional*
  - type: Function
  - default: `null`
  - description: Callback to be invoked with analysis object
  - function will be invoked with:
    - **analysisObject** *(Object)*
      - **modules** *(Array)* - array of `module` analysis objects
        - **module** *(Object)*
          - **id** *(String)* - path of module / rollup module id
          - **files** *(Array)* - list of files

---
_Source: https://npm.io/package/rollup-plugin-license-xml · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
