# generator-license

> Generate LICENSE file for your project using Yeoman.

Latest version **5.7.1** (published 2024-12-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install generator-license
pnpm add generator-license
yarn add generator-license
bun add generator-license
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities; has provenance.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.7.1 |
| Published | 2024-12-28 |
| First published | 2013-07-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 1 |
| Unpacked size | 144.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 59 |
| Author | Jozef Izso |
| Maintainers | jozefizso, sboudrias |
| Keywords | yeoman-generator, yeoman, generator, license |

## Links

- npm: https://www.npmjs.com/package/generator-license
- Repository: https://github.com/jozefizso/generator-license
- Issues: https://github.com/jozefizso/generator-license/issues
- npm.io page: https://npm.io/package/generator-license

## Dependencies (1)

- [yeoman-generator](https://npm.io/package/yeoman-generator.md) ^5.10.0

## Recent versions

- 5.7.1 (latest) — 2024-12-28
- 5.7.0 — 2024-06-24
- 5.6.0 — 2023-09-25
- 5.5.0 — 2021-06-14
- 5.4.0 — 2018-03-29
- 5.3.0 — 2018-03-29
- 5.2.0 — 2017-10-22
- 5.1.0 — 2017-01-15
- 5.0.1 — 2017-01-08
- 5.0.0 — 2017-01-01
- 4.0.0 — 2016-06-22
- 3.1.1 — 2016-01-24
- 3.1.0 — 2016-01-14
- 3.0.0 — 2015-10-24
- 2.0.1 — 2015-05-04
- … 7 more at https://npm.io/package/generator-license/versions

## README

# generator-license

[![build](https://github.com/jozefizso/generator-license/actions/workflows/build.yml/badge.svg)](https://github.com/jozefizso/generator-license/actions/workflows/build.yml)
![GitHub package.json version](https://img.shields.io/github/package-json/v/jozefizso/generator-license)
[![Coverage Status](https://coveralls.io/repos/github/jozefizso/generator-license/badge.svg)](https://coveralls.io/github/jozefizso/generator-license)
[![NPM version](https://img.shields.io/npm/v/generator-license.svg)](https://www.npmjs.org/package/generator-license)

> Generate LICENSE file for your project using Yeoman.

```
yo license
```


## Getting started
- Make sure you have [yo](https://github.com/yeoman/yo) installed:
    `npm install -g yo`
- Install the generator: `npm install -g generator-license`
- Run: `yo license`, enter your full name and choose a license

The generator will generate the `LICENSE` file and fill the `license` field of the `package.json`.

### Compose with generator license in your own generator

`generator-license` can be easily embedded into your own generator using [Yeoman composability](http://yeoman.io/authoring/composability.html).

First, install `generator-license` as a dependency of your own generator.

```
npm install --save generator-license
```

Then call it from your generator.

```js
this.composeWith(require.resolve('generator-license'), {
  name: 'John Doe', // (optional) Owner's name
  email: 'john.doe@example.com', // (optional) Owner's email
  website: 'https://example.com', // (optional) Owner's website
  year: '1945', // (optional) License year (defaults to current year)
  licensePrompt: 'Which license do you want to use?', // (optional) customize license prompt text
  defaultLicense: 'MIT', // (optional) Select a default license
  license: 'MIT', // (optional) Select a license, so no license prompt will happen, in case you want to handle it outside of this generator
});
```

All the options are optional; the generator will prompt for answers when information is not provided.

### Supported licenses

- [Apache 2 License][10]
- [MIT License][20]
- [Mozilla Public License 2.0][30]
- [BSD 2-Clause (FreeBSD) License][40]
- [BSD 3-Clause (NewBSD) License][50]
- [Internet Systems Consortium (ISC) License][60]
- [GNU AGPL 3.0 License][70]
- [GNU GPL 3.0 License][80]
- [Unlicense][90]
- UNLICENSED

For [Creative Commons Licenses][200] (useful for media files, documentation and
other creative works) you can use [generator-license-cc][201].

## License
[MIT License](http://en.wikipedia.org/wiki/MIT_License)

[10]: http://choosealicense.com/licenses/apache/
[20]: http://choosealicense.com/licenses/mit/
[30]: http://choosealicense.com/licenses/mpl-2.0/
[40]: http://choosealicense.com/licenses/bsd/
[50]: http://choosealicense.com/licenses/bsd-3-clause/
[60]: http://en.wikipedia.org/wiki/ISC_license
[70]: http://choosealicense.com/licenses/agpl-3.0/
[80]: http://choosealicense.com/licenses/gpl-3.0/
[90]: http://unlicense.org/
[100]: http://choosealicense.com/licenses/no-license/
[200]: https://creativecommons.org/licenses/
[201]: https://github.com/ek9/generator-license-cc

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