Quickly generate license for repos. (Raizensu = License)
For now:
- MIT
- GPLv3 (GPL v3)
- Apache2 (Apache 2.0)
- LGPLv3 (LGPL v3)
- Anti996_zh (Anti996 license in Chinese)
- Anti996_en (Anti996 license in English)
This package provides both CLI and library usage.
Generally, we use this package as a dev dependency.
npm i raizensu -D
npm i raizensu -g
See parameters at Use as CLI
npx raizensu generate ...
You can set your config in raizensu.config.[ts,js,mjs,mts,cjs,cts,json]
import { defineConfig } from 'raizensu'
export default defineConfig({
cwd: './',
filename: 'LICENSE.txt',
date: 'June 26th, 2025', // not shown in MIT, BSD-3-Clause, Anti996
license: 'MIT',
copyrights: [{
year: '2025-present',
author: 'Vincent-the-gamer',
link: 'https://github.com/Vincent-the-gamer'
}]
})
File will be generated in ./target/LICENSE.txt
Example:
if msg returns empty string, that means license failed to generate.
import { Copyright, generateLicense } from 'raizensu'
const msg = await generateLicense({
license: 'GPLv3',
cwd: "./",
date: 'June 26th, 2025',
copyrights: <Copyright[]>[{
year: '2025-present',
author: 'Vincent-the-gamer',
link: 'https://github.com/Vincent-the-gamer'
}, {
year: '2025-present',
author: 'Random',
link: 'https://github.com/random'
}]
})
Result:
GNU GENERAL PUBLIC LICENSE
Version 3, June 26th, 2025
Copyright (c) 2025-present Vincent-the-gamer <https://github.com/Vincent-the-gamer>
Copyright (c) 2025-present Random <https://github.com/random>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
...
Example:
# This command generates a license with your config in `raizensu.config.ts`
raizensu generate
# This command generates a license with specified config.
# --type, -t <type>: License type.
# --cwd, -c <cwd>, Choose the path you want to generate your file.
# --date, -d <date>", Licese create date, can be any format, like 2025-06-26.
# --copyrights, -C <copyrights>, Copyrights, an array contains: year, author, link.
# --filename, -n <filename>, File name, e.g. license.txt.
raizensu generate -t MIT -c ./ -C '[{ "author": "Vincent-the-gamer" }]' -n "MIT.txt"
raizensu generate -t GPLv3 -c ./ -d June\ 26th \ 2025 -C '[{ "author": "Vincent-the-gamer" }]' -n "GPLv3.txt"
This work is dual-licensed under MIT and Anti996 (or any later version).
MIT License © 2025-PRESENT Vincent-the-gamer
Anti996 License © 2025-PRESENT Vincent-the-gamer