https://github.com/jozefizso/generator-license
Yeoman Generator - License
https://github.com/jozefizso/generator-license
nodejs yeoman yeoman-generator
Last synced: 29 days ago
JSON representation
Yeoman Generator - License
- Host: GitHub
- URL: https://github.com/jozefizso/generator-license
- Owner: jozefizso
- License: mit
- Created: 2013-07-15T16:54:33.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2023-09-25T14:45:48.000Z (over 1 year ago)
- Last Synced: 2024-04-15T01:47:59.304Z (about 1 year ago)
- Topics: nodejs, yeoman, yeoman-generator
- Language: JavaScript
- Size: 776 KB
- Stars: 59
- Watchers: 3
- Forks: 19
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
- jimsghstars - jozefizso/generator-license - Yeoman Generator - License (JavaScript)
README
# generator-license
[](https://github.com/jozefizso/generator-license/actions/workflows/build.yml)

[](https://coveralls.io/github/jozefizso/generator-license)
[](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 licenseThe 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: '[email protected]', // (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]
- UNLICENSEDFor [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