GithubHelp home page GithubHelp logo

licenser's Introduction

========================
== LICENSE GENERATOR ==
========================

Choosing an OSS license doesn’t need to be scary...
Visit: http://choosealicense.com/

Installation

$ npm install -g licenser

Usage

In your project directory root:

# Create or overwrite LICENSE file from package.json or from `licenser config`
$ licenser set

# Create or overwrite LICENSE file and update package.json
$ licenser set apache2
$ licenser set mit
$ licenser set gpl3

# Update the year in the LICENSE file
$ licenser update

Config

If a package.json is present at the working directory, author, project and license information is read from there.
If not, author information is read from ~/.gitconfig

Your default license and author data can be set globally:

$ licenser config --author="Mr. Fancy Pants" --email="[email protected]"
$ licenser config --default-name="LICENSE.txt" --license=CC-BY-NC-4.0

# To overwrite the package.json and file with the `licenser config` values  
# ATTN: Does not overwrite author(s) in package.json  
$ licenser set -g

You can also edit config.json directly.

Other Commands

The command line parameters are parsed by nomnom, so you can use licenser -h for information about the available commands and also licenser set -h for help on a specific command.

# Find you a license
$ licenser list -v # Verbose output for the most commonly used licenses
$ licenser list -c # Creative Commons licenses
$ licenser list open --osi # All OSI approved licenses matching 'open'

# Output license text to console
$ licenser print gpl3
$ licenser print gpl3 --header # Print the "HOW TO APPLY THESE TERMS" header

licenser's People

Contributors

laoujin avatar

Stargazers

Richard Littauer avatar  avatar Francois-Guillaume Ribreau avatar

Watchers

James Cloos avatar Richard Littauer avatar  avatar

Forkers

pombredanne

licenser's Issues

set with global config

if package.json.license present: take that one

if globalConfig is set with license:
--> update if no package.json or empty license
--> overwrite license only with -f if a package.json license is set

license file:
--> if other than default is existing: delete it when -f is passed and replace with new filename
--> if one exists: takes precedence over global defaultFileName (without -f)

set -f behavior

should it overwrite the author by the global configuration?
or keep the author from package.json?

what does the readme say atm

perhaps:
licenser set --global --> take all global config
licenser set MIT --> overwrite license only
licenser set --> take from package.json (unless no package.json)

so no more -f param because confusing?

has to do with changed author conifg behavior from earlier commit

Allow override of package.json author

Sometimes, the license does not belong to the package.json author - for instance, if they are working for a business. There should be a way to override grabbing the author.

add license notice to readme.md?

Also update README.md with:

$ lincenser set APACHE-2.0 --readme
$ sleep(one year)
$ licenser update --readme

Define your own header:

$ licenser config --header="## LICENSE\nLICENSED UNDER $licenseKey (c) $years $author"

Set it globally if you do not want to pass --readmeall the time:

$ licenser config --readme=custom # Add your personal header by default
$ licenser config --readme=header # Add header to README.md for GPL, Apache, ... licenses

header should probably fallback to custom for licenses that do not have a header defined.

By default do not touch the README.md file as this might be unexpected behavior:

$ licenser config --readme=not # Don't touch my readme!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.