Generate LICENSE file for your project using Yeoman.
yo license
- Make sure you have 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
.
generator-license
can be easily embedded into your own generator using Yeoman composability.
First, install generator-license
as a dependency of your own generator.
npm install --save generator-license
Then call it from your generator.
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)
defaultLicense: 'MIT', // (optional) Select a default license
});
All the options are optional; the generator will prompt for answers when information is not provided.