raizensu
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

Raizensu

npm version npm downloads License

Quickly generate license for repos. (Raizensu = License)

Supporting licenses

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)

Installation

This package provides both CLI and library usage.

Library

Generally, we use this package as a dev dependency.

npm i raizensu -D

CLI

npm i raizensu -g

Non-install CLI use

See parameters at Use as CLI

npx raizensu generate ...

Usage

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

Use as library

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.

...

Use as CLI

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"

Licenses

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

Readme

Keywords

none

Package Sidebar

Install

npm i raizensu

Weekly Downloads

175

Version

0.1.2

License

MIT

Unpacked Size

81.9 kB

Total Files

17

Last publish

Collaborators

  • vincent-the-gamer