npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gent-js/gent

v0.1.12

Published

template-based data generator.

Readme

GenT

GenT logo

NPM Version NPM License

Introduction

GenT is a template-based data generator. The generated data is used as test data for software that process such data. You can define data format with a simple text file (referred to as a "template") and obtain the output as text file. It means that both input and output are non-programing interfaces. These features are particularly useful as test data in end-to-end testing situations, rather than in Unit testing.

Features

  • "template" and "template commands"
    • define generating text data format with a "template" which is a simple text file.
    • embed "template commands" within a "template" with special syntax.
    • "template commands" generate dynamic value, thus generating data will be non-static.
    • there are various "template commands" and also easily add new command.
  • "meta file"
    • meta file allows to manage multiple templates and their probabilities.
  • "json mode"
    • json mode can control json structure.
  • output
    • flexible output interface.

Quick Start

[!NOTE] This quick start explains the steps how to use GenT as shell cli application. If you are looking for how to use as a dependency or how to develop, see other sections.

install with npm globally.

npm install -g @gent-js/gent

Then, create a template. Save the following content as a text file in any directory, for instance {dir path}/template.log.

<34>{{timestamp}} mymachine su: 'su root failed for lonvick on /dev/pts/8

Above content of template is a syslog format log but its timestamp part has been replaced with template command syntax {{timestamp}}.

Then, execute following command with previously created template path.

gent --template {dir path}/template.log --count 3

output file out.log will be created in current working directory. And content of output will be like following.

<34>2024-11-20T17:55:12.963+09:00 mymachine su: 'su root failed for lonvick on /dev/pts/8
<34>2024-11-21T03:02:42.440+09:00 mymachine su: 'su root failed for lonvick on /dev/pts/8
<34>2024-11-21T08:45:03.377+09:00 mymachine su: 'su root failed for lonvick on /dev/pts/8

Each text line is almost same as template content but template command part has been replaced with generated text by the template command.

This is basic mechanics of GenT.

Fully customized template example is following

<{{pri}}>{{timestamp --format "MMM dd hh:mm:ss"}} {{ipv4}} {{hacker.noun --variations 3}}[{{pid}}]: {{lorem.sentences}}

Template

Template file defines generating text data format.

Template is basically just a text file. You can embed template command with special syntax. So GenT process template command and replace command expression with command result.

Template Commands

basic template command syntax is following.

{{command_name}}

Some commands accept command option, command and option syntax is like shell command syntax.

{{command_name --optA --optBWithValue value}}

supporting template commands and their options are below.

Command List

Meta template sample

{
  "from": "2000-01-01T00:00:00+09:00",
  "to": "2020-12-31T23:59:59+09:00",
  "count": 100,
  "out": "out.log",
  "templates": [
    {
      "path": "template.log"
    }
  ]
}

Json mode

special commands

  • array length
"{{length --min 2 --max 5}}"
  • array item weight
{
  "{{weight}}": 1
}
  • value probability
{
  "{{probability}}": 50
}
  • dynamic value
{
  "{{type}}": "number",
  "{{content}}": "{{int}}"
}

Output

in cli, specify output path with out option.

gent --template {dir path}/template.log --count 3 --out path-to-out.log

in meta file, specify output path with out key.

{
  "out": "path-to-out.log"
}

moreover, you can use various output method and options in meta file. see output for details.

Development

development