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

create-structure-cli

v1.0.1

Published

Create a project structure from text or JSON input

Downloads

14

Readme

create-structure-cli

🚀 A powerful CLI tool to instantly create directory structures from text files or JSON templates

Quickly scaffold project directories, organize file structures, and set up development environments with a simple command. Perfect for developers, project managers, and anyone who needs to create consistent directory layouts.

✨ Features

  • 📁 Multiple Input Formats: Support for both tree-style text files and JSON structure definitions
  • 🎯 Interactive Mode: Smart prompts when arguments are missing
  • 🛡️ Robust Error Handling: Comprehensive validation and user-friendly error messages
  • 🌍 Cross-Platform: Works on Windows(tested), macOS(test needed), and Linux(test needed)
  • Fast & Lightweight: Zero dependencies, pure Node.js
  • 🔄 Flexible Paths: Support for both absolute and relative paths
  • 📝 Batch Operations: Create complex nested structures in seconds

📦 Installation

Global Installation (Recommended)

npm install -g create-structure-cli

Local Installation

npm install create-structure-cli

Using npx (No Installation Required)

npx create-structure-cli

🚀 Quick Start

# Interactive mode - get prompted for inputs
create-structure

# Specify structure file only (default output directory is current directory)
# Tree-style text file
create-structure ./project-structure.txt 
# or
# JSON style structure
create-structure ./project-structure.json

# Specify both structure file and output directory - output directory will be created if it doesn't exist and no prompts will be shown
create-structure ./structure.json ./my-new-project

🚀 Usage

create-structure [structure_file] [output_directory]

Parameters:

  • structure_file: The path to the structure file. It can be a tree-style text file or a JSON file.
  • output_directory: The directory where the structure will be created. If not provided, the current directory will be used.

📝 Structure File Formats

  1. Tree-Style Text Format Create a .txt file with your directory structure using tree notation:
my-project/
├── src/
│   ├── components/
│   │   ├── Header.jsx
│   │   ├── Footer.jsx
│   │   └── Layout.jsx
│   ├── pages/
│   │   ├── Home.jsx
│   │   └── About.jsx
│   ├── utils/
│   │   ├── helpers.js
│   │   └── constants.js
│   └── App.jsx
├── public/
│   ├── index.html
│   ├── favicon.ico
│   └── assets/
│       ├── images/
│       └── styles/
├── tests/
│   ├── components/
│   └── utils/
├── docs/
│   ├── README.md
│   └── API.md
├── .gitignore
├── package.json
└── README.md

Supported Tree Characters:

  • ├── for branches
  • └── for last items
  • for vertical lines
  • Folders must end with /
  • Files without / are treated as files

My suggestion you can use the tree.nathanfriend.com to draw your structure.

  1. JSON Format Create a .json file with your directory structure using JSON notation:
{
  "my-project": {
    "src": {
      "components": {
        "Header.jsx": "",
        "Footer.jsx": "",
        "Layout.jsx": ""
      },
      "pages": {
        "Home.jsx": "",
        "About.jsx": ""
      },
      "utils": {
        "helpers.js": "// Utility functions",
        "constants.js": "// App constants"
      },
      "App.jsx": ""
    },
    "public": {
      "index.html": "<!DOCTYPE html>...",
      "favicon.ico": "",
      "assets": {
        "images": {},
        "styles": {}
      }
    },
    "tests": {
      "components": {},
      "utils": {}
    },
    "docs": {
      "README.md": "# Documentation",
      "API.md": "# API Reference"
    },
    ".gitignore": "node_modules/\n.env\ndist/",
    "package.json": "",
    "README.md": "# My Project"
  }
}

JSON Structure Rules:

  • Objects represent directories
  • String values represent file content
  • Empty strings create empty files
  • Nested objects create nested directories

Upcoming Features

  • many preset templates for boilerplate projects
  • support for YAML and other structure formats

Contributing or Pull Requests

I welcome contributions! Please follow the Contributing Guidelines to contribute to this project.

📝 License

This project is released under the MIT License.

📝 Issues

Found a bug or have a feature request?
Please open an issue using one of our templates.

📝 Changelog

See the Changelog for a detailed history of changes and releases.

📝 Credits

Made with ❤️ by 🙋‍‍ Sayantan Chakraborty