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 🙏

© 2024 – Pkg Stats / Ryan Hefner

struct-nd

v2.1.0

Published

`struct-nd` is a Node.js package that simplifies the process of setting up a standard Node.js project structure. With a single command, you can generate the recommended file and directory layout commonly used in Node.js projects.

Downloads

12

Readme

struct-nd

struct-nd is a Node.js package that simplifies the process of setting up a standard Node.js project structure. With a single command, you can generate the recommended file and directory layout commonly used in Node.js projects.

Installation:

  • To install struct-nd, use the following command: npm install -g struct-nd This will make the struct command available globally on your system.

  • or npm install struct-nd

Usage:

  • run command struct express to generating expressjs project structure.
  • struct rest - Rest Api structure.
  • struct graph - Graphql structure.
  • struct typescript - Typescript structure.
  • struct nextjs - nextjs structure.

Express js Project structure:

        my-nodejs-project/
├── node_modules/           # Installed dependencies (auto-generated)
├── public/                 # Static assets (CSS, images, client-side JS)
│   ├── css/
│   ├── images/
│   └── scripts/
├── src/                    # Source code
│   ├── controllers/        # Request handlers
│   ├── middlewares/        # Functions that handle request processing
│   ├── models/             # Data models and database schemas
│   ├── routes/             # Application routes
│   ├── services/           # Business logic and data processing
│   └── views/              # Template files (if using a templating engine)
├── config/                 # Configuration files (database, environment)
│   ├── database.js
│   ├── environment.js
├── tests/                  # Unit and integration tests
├── .gitignore              # Ignored files and directories for version control
└── README.md               # Project documentation

Rest Api Project Structure:

  my-rest-api/
├── node_modules/           # Installed dependencies (auto-generated)
├── src/                    # Source code
│   ├── controllers/        # API route handlers
│   ├── middlewares/        # Middleware functions
│   ├── models/             # Data models and database schemas
│   ├── routes/             # API routes
│   ├── services/           # Business logic and data processing
├── config/                 # Configuration files (database, environment)
│   ├── database.js
│   ├── environment.js
├── tests/                  # Unit and integration tests
├── .gitignore              # Ignored files and directories for version control
└── README.md               # Project documentation

GraphQL Project Structure:

my-graphql-project/
├── node_modules/           # Installed dependencies (auto-generated)
├── src/                    # Source code
│   ├── graphql/            # GraphQL schema, resolvers, and types
│   ├── models/             # Data models and database schemas
│   ├── services/           # Business logic and data processing
├── config/                 # Configuration files (database, environment)
│   ├── database.js
│   ├── environment.js
├── tests/                  # Unit and integration tests
├── .gitignore              # Ignored files and directories for version control
└── README.md               # Project documentation

TypeScript Project Structure:

my-typescript-project/
├── node_modules/           # Installed dependencies (auto-generated)
├── src/                    # TypeScript source code
│   ├── controllers/
│   ├── middlewares/
│   ├── models/
│   ├── routes/
│   ├── services/
├── config/                 # Configuration files (database, environment)
│   ├── database.ts
│   ├── environment.ts
├── tests/                  # Unit and integration tests
├── tsconfig.json           # TypeScript compiler configuration
├── .gitignore              # Ignored files and directories for version control
└── README.md               # Project documentation

Nextjs Project structure:

my-nextjs-project/
├── node_modules/           # Installed dependencies (auto-generated)
├── public/                 # Static assets (images, etc.)
├── src/                    # Source code
│   ├── components/         # Reusable components
│   ├── pages/              # Next.js pages
│   │   ├── api/            # API routes (serverless functions)
│   │   ├── _app.js         # Custom App component
│   │   ├── _document.js    # Custom Document component
│   ├── styles/             # CSS/Sass styles
│   ├── utils/              # Utility functions
│   ├── hooks/              # Custom hooks
│   ├── contexts/           # Context providers
│   ├── lib/                # Libraries and helper functions
├── tests/                  # Unit and integration tests
├── .gitignore              # Ignored files and directories for version control
├── next.config.js          # Next.js configuration
├── package.json            # Project dependencies and scripts
├── README.md               # Project documentation
├── jsconfig.json           # JavaScript configuration (or tsconfig.json for TypeScript)
└── .env                    # Environment variables