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

gfiletinator

v1.0.0

Published

Generate file with data and directory structure based on a text file

Downloads

7

Readme

gfileTinator 🚀

A simple Node.js script for rapidly creating a project's directory and file structure based on a predefined text file. Ideal for quickly bootstrapping new projects or generating repetitive code snippets.

Features ✨

  • Parses a specific text format defining files and their content
  • Automatically creates nested directories as needed
  • Populates created files with the provided content, preserving indentation
  • Supports creating empty files if a block contains no content
  • Displays clear progress logs and potential errors during generation

Prerequisites 📋

  • Node.js: Installed on your system (LTS version or newer recommended). You can check your version by typing node -v in your terminal.

Installation 💾

Option 1: Local Installation

  1. Clone the repository:

    git clone https://github.com/stanislawmocia/gfileTinator.git
    cd gfileTinator
  2. Make it executable:

    chmod +x gfileTinator.js

Option 2: Global NPM Installation

Install the package globally to use it from anywhere:

npm install -g gfiletinator

Usage 🛠️

Run the script from your terminal, providing the path to the text file containing the structure definition as an argument. You should run the script inside the directory where you want the new project structure to be generated.

# Local usage
node gfileTinator.js <path/to/your/structure_file.txt>

# If made executable
./gfileTinator.js <path/to/your/structure_file.txt>

# If installed globally
gfiletinator <path/to/your/structure_file.txt>

Example:

node gfileTinator.js project_template.txt

Input File Format 📝

The input file (e.g., project_template.txt) defines the structure using a specific format:

  • Separators: Individual file definitions are separated from each other by a long line of dashes:
    ––––––––––––––––––––––––––––––––––
  • File Path: Immediately after the separator, on a new line, is the relative path to the file to be created (e.g., src/components/Button.js or .gitignore).
  • File Content: All lines following the file path, up to the next separator (or the end of the file), constitute the content of that file.
    • Indentation and formatting within the content block are preserved.
    • Empty lines at the very beginning and end of the content block are ignored (trimmed).
    • If there are no content lines after the file path before the next separator, an empty file will be created.

Example Input File (example_structure.txt)

––––––––––––––––––––––––––––––––––
README.md
––––––––––––––––––––––––––––––––––

# My Awesome New Project

Project description goes here.

## Getting Started
1. Clone the repo.
2. Run `npm install`.
3. ...

––––––––––––––––––––––––––––––––––
src/main.js
––––––––––––––––––––––––––––––––––

// Main application file
function startApp() {
  console.log("Application starting!");
  // TODO: Add more logic
}

startApp();

––––––––––––––––––––––––––––––––––
config/.env.example
––––––––––––––––––––––––––––––––––

API_KEY=your_api_key
DATABASE_URL=postgresql://user:pass@host:port/db

––––––––––––––––––––––––––––––––––
docs/empty_notes.txt
––––––––––––––––––––––––––––––––––

Result of Running the Example

The following structure will be created in the directory where the script was executed:

.
├── README.md
├── config/
│   └── .env.example
├── docs/
│   └── empty_notes.txt
└── src/
    └── main.js

The files README.md, src/main.js, and config/.env.example will contain the content defined in example_structure.txt, and docs/empty_notes.txt will be an empty file.

License 📄

This script is released under the ISC License. Feel free to use and modify it as you wish.