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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-initdb

v2.0.6

Published

A CLI tool to create a folder and file with some code

Downloads

3,991

Readme


node-initdb is a CLI tool for initializing project configurations and structures in Node.js projects. It now requires you to select a database, a web framework, a language (JavaScript or TypeScript), and a package manager for the tool to work. In addition to setting up your chosen database and framework, node-initdb now supports file upload functionality and JWT-based authentication.

Node InitDB Plugin Demo

Installation

Install node-initdb globally using npm:

npm install -g node-initdb

Usage

Navigate to your project directory and run node-initdb with the appropriate options. You must choose one option each for:

  • Database:

    • MongoDB: --mongo or -m
    • Sequelize: --seque or -s
  • Web Framework:

    • Express: --express or -e
    • Fastify: --fastify or -f
    • Elysia: --elysia or -el
  • Language:

    • JavaScript: --javascript or -j
    • TypeScript: --typescript or -t
  • Package Manager:

    • Npm: --npm or -n
    • Bun: --bun or -b
    • Yarn: --yarn or -ya
    • Pnpm: --pnpm or -pn

Important: All four categories (database, framework, language, and package manager) are required. If any one is missing, node-initdb will not run.

Optionally, you can add --yes (or -y) to skip interactive prompts and use default values.

Examples

  • MongoDB, Express, and TypeScript with npm:

    node-initdb --mongo --express --typescript --npm
    # or shorthand:
    node-initdb -m -e -t -n
  • Sequelize, Fastify, and JavaScript with bun:

    node-initdb --seque --fastify --javascript --bun
    # or shorthand:
    node-initdb -s -f -j -b
  • Sequelize, Elysia, and JavaScript with yarn:

    node-initdb --seque --elysia --javascript --yarn
    # or shorthand:
    node-initdb -s -el -j -ya

Add Module Task

To add a new module using node-add, run:

node-add <moduleName> [options]

Replace <moduleName> with your desired module name. Use the same options for database, framework, language, and package manager:

  • Database: -m / --mongo, -s / --seque
  • Framework: -e / --express, -f / --fastify, -el / --elysia
  • Language: -j / --javascript, -t / --typescript
  • Package Manager: -n / --npm, -b / --bun, -ya / --yarn, -pn / --pnpm

Example

node-add "user" -m -e -t

Folder Structure

After running node-initdb, your project will have the following structure:

- config/
- Controllers/
- Routes/
- Models/
- Middleware/
- uploads/
- Utils/

Files Created

node-initdb creates essential files such as controllers, routes, models, configuration files, and middleware. In addition, the setup includes:

  • File Upload: Pre-configured file upload functionality.
  • JWT Authentication: Setup for JWT-based authentication.

Dependencies

Depending on your chosen configuration, node-initdb installs the following dependencies:

  • Database:
    • MongoDB: mongoose
    • Sequelize: sequelize, mysql2
  • Web Framework:
    • Express: express
    • Fastify: fastify
    • Elysia: elysia
  • New Features:
    • File Upload: multer
    • JWT Authentication: jsonwebtoken

Contributing

Contributions are welcome! Fork the repository, implement your changes, and submit a pull request. Please follow the existing coding style and guidelines.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Get in Touch

For questions or support, feel free to reach out:

Support

If you find node-initdb useful, please consider supporting the project: