Licensing via CLI (Command-Line), CI (Continuous Integration), and API
This cix-lic modules can license a project via several capabilities.
- CLI - Command Line
- CI - Continuous Integration
- API - Application Program Interface
Before we use cix-lic, it's important to know what properties are used. It's called LIC Properties.
-
lic | -l - the license identifier, see licenses - default: "License"
-
owner | -o - the owner - default: "Unknown"
-
beginYear | -b - the declarative begin year - default: current year
-
endYear | -e - the declarative end year - default: "Present"
-
proc | -p - the process - default: ["lic", "file"]
-
baseDir | -d - the directory where to query files - default: root source directory
-
filter | -f - the file filter can be string, RegExp, or { test: () => boolean } - default: *.js
-
HFLcontent | -h - the Head File License Content (file header content) - default: undefined
-
licenseContent | -c - the License Content (license content) - default: undefined
-
licenseFile - the License File (license file) - default: ./LICENSE
npm install -g cix-lic
cix-lic [Command Tags]
npm install cix-lic --save-dev
In package.json file,
// in package.json file
{
"scripts": {
"cix-lic": "cix-lic [Command Tags]"
...
}
}
Then, we can run cix-lic script in CI Process.
Command Tags are LIC Properties
Examples
cix-lic -o Jane Smith -l mit >> owner: Jane Smith, lic: MIT License
cix-lic -d ./lib -l apache-2.0 >> baseDir: ./lib, lic: Apache License 2.0