DEV Community

Cover image for OSD600 Static Site Generator (Release 0.1)
Hung Nguyen
Hung Nguyen

Posted on

OSD600 Static Site Generator (Release 0.1)

OSD600 Static Site Generator(osdssg) allows users to generate HTML file(s) from raw data and files. This tool will run by using the command-line.


  • JavaScript

Supporting packages:

  • yargs
  • node-html-parser


  • Generating an HTML file from user's file input.
  • Generating HTML file(s) from user's folder input (Each file inside the directory will generate 1 HTML file).
  • File(s) generated will be stored inside new created "dist" directory.
  • "dist" folder will renew every time a new command-line executed (Old file(s) will be deleted and new file(s) will be added).
  • Creating a title inside head tag and transforming the first line of the text to h1 tag.
  • Creating stylesheet link tag if users use --stylesheet or -s flag.

-v,--version: Show current version of osdssg
-h,--help: Display all options available
-i,--input: Input file or directory and generate HTML file(s)


git clone
cd OSD600-SSG
npm install // install all the packages required
npm link // link my-command file with package.json so that you can use the osdssg command
Enter fullscreen mode Exit fullscreen mode


osdssg -i <file's location> // (If file name has whitespaces, put it into a double quote e.g: osdssg -i "Silver Blaze.txt")
osdssg --input <directory's location> // Read all files inside and creates html files for each
Enter fullscreen mode Exit fullscreen mode

Example 1:

  • Generate an .txt file into .html file. You can see that the "Silver Blaze.txt" is inside the root folder. Alt Text As a result, index.html is created inside "dist" directory with new title and a h1 text at the top of the body tag. Alt Text

Example 2:

  • Generate all files inside a directory into HTML files with stylesheet link added. "dir1" is inside the root folder

  • New files are generated inside "dist" (old index.html has been removed) and link tag has been added to each html file.
    Alt Text

Note: This is first version of the program so it may contain some errors. If you catch some, feel free to contact me.

Repo link:

Top comments (0)