Skip to content

jozefizso/generator-license

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6930abf · Dec 28, 2024
Dec 28, 2024
May 20, 2022
May 20, 2022
Oct 22, 2017
Oct 22, 2017
Jul 15, 2013
Oct 22, 2017
May 3, 2015
Sep 25, 2023
Jan 1, 2017
Feb 21, 2014
Mar 4, 2023
Dec 28, 2024
Dec 28, 2024

Repository files navigation

generator-license

build GitHub package.json version Coverage Status NPM version

Generate LICENSE file for your project using Yeoman.

yo license

Getting started

  • 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.

Compose with generator license in your own generator

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)
  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

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

License

MIT License