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

cli-ssg

v1.0.1

Published

Tool to generate HTML web sites using txt

Readme

cli-ssg

stage badge stage badge

Tool to generate html web site from txt or md input

Installation

npm i cli-ssg

Usage

cli-ssg -i "sample_file.txt"

This processes text from sample_file.txt and generates sample_file.html

cli-ssg -i "sample_file.txt" -s "./stylesheet.css"

Same as above, however sample_file.html now uses ./stylesheet.css

cli-ssg -i "sample_dir" -o "output_dir"

This processes all the .txt and .md files in sample_dir and generates .html files for each of them. It also creates an index.html with relative links to each page, storing all these files in output_dir.

Options

  -h, --help        Show help                                          [boolean]
  -v, --version     Show version number                                [boolean]
  -i, --input       Input file/folder to be processed        [string] [required]
  -o, --output      Output directory                [string] [default: "./dist"]
  -s, --stylesheet  CSS Stylesheet for the website                      [string]
  -l, --lang        Lang attribute for html element  [string] [default: "en-CA"]
  -c, --config      Pass JSON file for options                          [string]

Features

:white_check_mark: Ability to provide a custom output directory
:white_check_mark: Ability to provide stylesheet URL
:white_check_mark: Recursively parses input nested directories and files
:white_check_mark: Automatically generates index.html if multiple txt or md files are present in input directory
:white_check_mark: .md files now accepted as input
:white_check_mark: Ability to parse all markdown syntax to generate HTML
:white_check_mark: Ability to specify the language using a -l flag
:white_check_mark: Pass a JSON file for the options
:white_check_mark: Parse title and paragraphs from the input txt files

Examples

Simple Example

cli-ssg -i ".\sample_input.txt" -o "custom_dir" -s "https://cdnjs.cloudflare.com/ajax/libs/tufte-css/1.8.0/tufte.min.css"

sample_input.txt

Sample title                   //<---first line followed by 2 empty lines treated as title


This is the first paragraph.
                               //<--- blank spaces treated as paragraph limits
This is the second paragraph.

This is the third paragraph

custom_dir\sample_output.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Sample title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link
      href="https://cdnjs.cloudflare.com/ajax/libs/tufte-css/1.8.0/tufte.min.css"
      rel="stylesheet"
    />
  </head>
  <body>
    <h1>Sample title</h1>
    <p>This is the first paragraph.</p>
    <p>This is the second paragraph.</p>
  </body>
</html>

Complex Example

Using multiple text files in the input directory, the following website was created with an auto-generated index.html having links to each individual page:

https://cli-ssg.vercel.app/

Use a config JSON file

A .JSON file can also be used to supply arguments instead of using the command line.

cli-ssg -i ".\sample_input.txt" -o "custom_dir" -s "https://cdnjs.cloudflare.com/ajax/libs/tufte-css/1.8.0/tufte.min.css"

For example, the above is equivalent to

cli-ssg -c "config.json"

where config.json:

{
    "input": "./sample_input.txt",
    "output":"custom_dir",
    "stylesheet": "https://cdnjs.cloudflare.com/ajax/libs/tufte-css/1.8.0/tufte.min.css"
}

License

MIT