/intemp

Drafting

Primary LanguageTypeScriptMIT LicenseMIT

Inline Templator (intemp)

Fill configurations template with github-action-style inline Env or File.

Use cases:

Yaml templator:

Input Files:

./config.intemp.yaml

Client: GoCQHttp
GoCQHttp:
  type: HTTP
  access_token: ${{ env.ACCESS_TOKEN }}
  api_root: http://go-cqhttp:5700/
  api_timeout: 60
  host: 0.0.0.0
  port: 8000

./.env

# .env
ACCESS_TOKEN=icX7z8qE4GA5YRzg

Run:

bunx intemp

Output Files:

./config.yaml

# config.yaml

Client: GoCQHttp
GoCQHttp:
  type: HTTP
  access_token: icX7z8qE4GA5YRzg
  api_root: http://go-cqhttp:5700/
  api_timeout: 60
  host: 0.0.0.0
  port: 8000

README templator:

Input Files:

./README.intemp.md

Run:

bunx intemp

Output Files:

./README.md (Yes, You are reading the output of intemp.)

MyIP Templator, fetching your IP from web, fill into myip.txt

Input Files:

./myip.intemp.txt

${{ https://ifconfig.me/ip }}

Run:

bunx intemp

Output Files:

./myip.txt