🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

jatg

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jatg

Just Another Template Generator

latest
Source
npmnpm
Version
1.3.2
Version published
Maintainers
1
Created
Source

jatg - just another template generator

NPM

jatg is a low configuration tool to generate files based on templates.

Most template generation tools require elaborate configurations, lack intuitive usage, are tied to a specific framework or do not support variable transformations. The objective of this tool is to be as intuitive as possible while providing a flexible feature set.

Simply create your template files, add them to the configuration file and then run jatg to generate the resulting files.

Setting Up

Create the templates.json

You can create the file by running npx jatg --init, or just start by copying the example below:

templates.json

{
  "$schema": "https://unpkg.com/jatg/templates.schema.json",
  "templates": [
    {
      "name": "my-awesome-template",
      "sourcePaths": ["./templates"],
      "outputPath": "./src/modules",
      "variables": [
        {
          "variable": "name",
          "name": "Module Name"
        }
      ]
    }
  ]
}

This should be enough for most use-cases, but you can read the configuration reference for a list of all possible properties.

Create your template files

You can have as many files as needed for a single template.

templates/%name%.ts

export class %name.pascalCase% {
  // ...
}

The template can have variables, and they can be transformed through functions. Read more about them in the variables reference.

Run it

Just run the CLI to generate files based on the templates created.

You'll be prompted which template you want to generate, and what are the variable values.

npx jatg

Pretty straightforward, isn't it?

Reference

Samples

Check the samples directory for config and template examples.

Keywords

template

FAQs

Package last updated on 11 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts