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

rakitin

v1.0.0

Published

CLI rakitin buat generate boilerplate modular backend ๐Ÿ˜Ž

Readme

๐Ÿš€ rakitin

npm version License: MIT

๐Ÿ‡ฎ๐Ÿ‡ฉ Bahasa Indonesia

Deskripsi Proyek

rakitin adalah Command Line Interface (CLI) yang dirancang khusus untuk mempercepat proses pengembangan backend modular dengan Node.js dan Express.js. CLI ini membantu Anda menggenerate boilerplate kode untuk berbagai komponen aplikasi seperti modul, middleware, utilitas, dan konfigurasi, sehingga Anda dapat fokus pada logika bisnis inti aplikasi Anda.

Fitur Utama

rakitin menawarkan kemampuan generate kode untuk berbagai kebutuhan:

  • Module: Membangun struktur modul aplikasi dengan dua pilihan arsitektur:
    • Simple: Modul akan memiliki controller, service, dan router dalam satu direktori modul.
    • Modular: Modul akan memiliki sub-direktori terpisah untuk controllers, services, models, dan routes, mendorong modularitas yang lebih ketat.
    • Pilihan untuk mengintegrasikan ORM (Prisma, Sequelize, Mongoose, TypeORM).
  • Middleware: Generate berbagai jenis middleware Express.js:
    • Custom: Membuat middleware kosong yang dapat Anda isi dengan logika sendiri.
    • auth: Middleware otentikasi menggunakan JWT.
    • logger: Middleware untuk logging permintaan masuk ke konsol.
    • error: Middleware penanganan error global.
    • request-time: Middleware untuk mencatat waktu yang dibutuhkan untuk setiap permintaan.
  • Util: Membuat file utilitas dengan berbagai fungsi yang sering digunakan:
    • Custom: Membuat utilitas kosong.
    • date: Fungsi-fungsi utilitas terkait tanggal (misalnya, now, format, add, subtract, isBefore, isAfter).
    • string: Fungsi-fungsi utilitas terkait string (misalnya, capitalize, kebabCase, camelCase, truncate, reverse).
    • number: Fungsi-fungsi utilitas terkait angka (misalnya, clamp, isEven, isOdd, randomInt, toCurrency).
    • array: Fungsi-fungsi utilitas terkait array (misalnya, unique, flatten, chunk, compact).
    • object: Fungsi-fungsi utilitas terkait objek (misalnya, isEmpty, deepClone, merge).
    • file: Fungsi-fungsi utilitas terkait sistem file (misalnya, readJson, writeJson, exists).
    • crypto: Fungsi-fungsi utilitas kriptografi (misalnya, hashSHA256, randomHex).
    • uuid: Fungsi untuk generate UUID (misalnya, generate, short).
    • env: Fungsi untuk membaca variabel lingkungan dari .env (misalnya, get, requireEnv).
    • url: Fungsi untuk memparsing atau mendapatkan hostname dari URL.
    • color: Fungsi untuk mengkonversi hex ke RGB.
    • math: Fungsi matematika dasar (misalnya, sum, average, max).
    • validation: Fungsi validasi dasar (misalnya, isEmail, isUrl).
    • regex: Fungsi utilitas regex (misalnya, matchAll, escape).
    • time: Fungsi utilitas terkait waktu (misalnya, sleep, now).
  • Config (Dalam Pengembangan): Fitur ini akan membantu dalam membuat file konfigurasi standar untuk berbagai kebutuhan aplikasi.
  • Integrasi Router Utama (Dalam Pengembangan): Fitur ini akan mempermudah integrasi router modul yang baru dibuat ke dalam router utama aplikasi, mengurangi kerja manual.

Instalasi

Untuk menggunakan rakitin, pastikan Anda memiliki Node.js (versi >=18) dan npm terinstal di sistem Anda.

  1. Kloning repositori:
    git clone [https://github.com/reinvy/rakitin.git](https://github.com/reinvy/rakitin.git)
    cd rakitin/rakitin-development # atau di mana pun Anda mengekstrak file
  2. Instal dependensi:
    npm install
  3. Jalankan CLI secara lokal (opsional, untuk pengembangan/pengujian):
    npm start
    Atau, untuk membuatnya tersedia sebagai perintah global rakitin:
    npm link

Penggunaan

Setelah instalasi, Anda dapat menjalankan rakitin dari terminal:

rakitin

Anda akan disambut dengan prompt interaktif yang menanyakan "Apa yang ingin Anda generate?".

๐Ÿš€ Hai Sayang! Ini CLI rakitin-mu!
? Apa yang ingin Anda generate? (Use arrow keys)
โฏ Module
  Middleware
  Util
  Config
  Integrasi Router Utama

Pilih fitur yang ingin Anda generate menggunakan tombol panah atas/bawah dan tekan Enter. CLI akan memandu Anda melalui prompt tambahan sesuai dengan pilihan Anda.

Contoh Penggunaan: Membuat Modul

  1. Jalankan rakitin.
  2. Pilih Module.
  3. Masukkan nama modul Anda (misalnya, User).
  4. Pilih arsitektur (Simple atau Modular).
  5. Pilih apakah akan menggunakan ORM atau tidak.
  6. Jika memilih ORM, pilih ORM/Database yang diinginkan.

rakitin akan membuat struktur folder dan file yang sesuai di dalam direktori app/modules/user Anda.

Struktur Proyek

Berikut adalah gambaran umum struktur proyek yang dibuat atau diinteraksi oleh rakitin:

.
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ modules/          # Folder untuk modul aplikasi Anda
โ”‚   โ”‚   โ””โ”€โ”€ [module-name]/
โ”‚   โ”‚       โ”œโ”€โ”€ [module-name].controller.js (Simple Arch)
โ”‚   โ”‚       โ”œโ”€โ”€ [module-name].service.js (Simple Arch)
โ”‚   โ”‚       โ”œโ”€โ”€ [module-name].routes.js (Simple Arch)
โ”‚   โ”‚       โ””โ”€โ”€ controllers/ (Modular Arch)
โ”‚   โ”‚       โ””โ”€โ”€ services/ (Modular Arch)
โ”‚   โ”‚       โ””โ”€โ”€ models/ (Modular Arch)
โ”‚   โ”‚       โ””โ”€โ”€ routes/ (Modular Arch)
โ”‚   โ”œโ”€โ”€ shared/           # Folder untuk komponen yang dibagikan antar modul
โ”‚   โ”‚   โ”œโ”€โ”€ middlewares/  # Middleware aplikasi
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ [middleware-name].middleware.js
โ”‚   โ”‚   โ”œโ”€โ”€ config/       # File konfigurasi
โ”‚   โ”‚   โ”œโ”€โ”€ utils/        # File utilitas
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ [util-name].util.js
โ”‚   โ”‚   โ””โ”€โ”€ interfaces/   # Definisi interface/tipe (jika ada)
โ”‚   โ”œโ”€โ”€ app.js            # File inisialisasi aplikasi Express
โ”‚   โ””โ”€โ”€ server.js         # Titik masuk utama aplikasi
โ”œโ”€โ”€ bin/
โ”‚   โ””โ”€โ”€ rakitin.js        # Executable CLI
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ generator/        # Logika untuk generate berbagai fitur
โ”‚   โ”‚   โ”œโ”€โ”€ config/       # Logika generator Config (Dalam Pengembangan)
โ”‚   โ”‚   โ”œโ”€โ”€ middleware/
โ”‚   โ”‚   โ”œโ”€โ”€ module/
โ”‚   โ”‚   โ”œโ”€โ”€ router/       # Logika generator Router Utama (Dalam Pengembangan)
โ”‚   โ”‚   โ””โ”€โ”€ util/
โ”‚   โ”œโ”€โ”€ constants.js      # Definisi path konstan
โ”‚   โ”œโ”€โ”€ prompt.js         # Logika prompt interaktif
โ”‚   โ””โ”€โ”€ utils.js          # Fungsi utilitas internal CLI
โ”œโ”€โ”€ index.js              # Logika utama CLI
โ”œโ”€โ”€ package.json          # Metadata proyek dan dependensi
โ”œโ”€โ”€ package-lock.json     # Resolusi dependensi
โ””โ”€โ”€ .gitignore            # File yang diabaikan oleh Git

Lisensi

Proyek ini dilisensikan di bawah Lisensi MIT.

Kontribusi

Kontribusi dipersilakan! Jika Anda memiliki ide atau menemukan bug, silakan ajukan issue atau pull request.

Kontak

Author: Reinvy


๐Ÿ‡ฌ๐Ÿ‡ง English

Project Description

rakitin is a Command Line Interface (CLI) specifically designed to accelerate the development process of modular backend applications with Node.js and Express.js. This CLI helps you generate boilerplate code for various application components such as modules, middleware, utilities, and configurations, allowing you to focus on your application's core business logic.

Key Features

rakitin offers code generation capabilities for various needs:

  • Module: Builds application module structures with two architecture options:
    • Simple: Modules will have controllers, services, and routers within a single module directory.
    • Modular: Modules will have separate sub-directories for controllers, services, models, and routes, promoting stricter modularity.
    • Option to integrate ORMs (Prisma, Sequelize, Mongoose, TypeORM).
  • Middleware: Generates various types of Express.js middleware:
    • Custom: Creates an empty middleware that you can fill with your own logic.
    • auth: Authentication middleware using JWT.
    • logger: Middleware for logging incoming requests to the console.
    • error: Global error handling middleware.
    • request-time: Middleware for logging the time taken for each request.
  • Util: Creates utility files with various commonly used functions:
    • Custom: Creates an empty utility.
    • date: Date-related utility functions (e.g., now, format, add, subtract, isBefore, isAfter).
    • string: String-related utility functions (e.g., capitalize, kebabCase, camelCase, truncate, reverse).
    • number: Number-related utility functions (e.g., clamp, isEven, isOdd, randomInt, toCurrency).
    • array: Array-related utility functions (e.g., unique, flatten, chunk, compact).
    • object: Object-related utility functions (e.g., isEmpty, deepClone, merge).
    • file: File system-related utility functions (e.g., readJson, writeJson, exists).
    • crypto: Cryptography utility functions (e.g., hashSHA256, randomHex).
    • uuid: Functions to generate UUIDs (e.g., generate, short).
    • env: Functions to read environment variables from .env (e.g., get, requireEnv).
    • url: Functions to parse or get hostname from a URL.
    • color: Function to convert hex to RGB.
    • math: Basic mathematical functions (e.g., sum, average, max).
    • validation: Basic validation functions (e.g., isEmail, isUrl).
    • regex: Regex utility functions (e.g., matchAll, escape).
    • time: Time-related utility functions (e.g., sleep, now).
  • Config (Under Development): This feature will assist in creating standard configuration files for various application needs.
  • Main Router Integration (Under Development): This feature will simplify the integration of newly created module routers into the application's main router, reducing manual effort.

Installation

To use rakitin, ensure you have Node.js (version >=18) and npm installed on your system.

  1. Clone the repository:
    git clone [https://github.com/reinvy/rakitin.git](https://github.com/reinvy/rakitin.git)
    cd rakitin/rakitin-development # or wherever you extracted the files
  2. Install dependencies:
    npm install
  3. Run the CLI locally (optional, for development/testing):
    npm start
    Or, to make it available as a global rakitin command:
    npm link

Usage

After installation, you can run rakitin from your terminal:

rakitin

You will be greeted with an interactive prompt asking "Apa yang ingin Anda generate?" (What do you want to generate?).

๐Ÿš€ Hai Sayang! Ini CLI rakitin-mu!
? Apa yang ingin Anda generate? (Use arrow keys)
โฏ Module
  Middleware
  Util
  Config
  Integrasi Router Utama

Select the feature you want to generate using the up/down arrow keys and press Enter. The CLI will guide you through additional prompts based on your selection.

Usage Example: Creating a Module

  1. Run rakitin.
  2. Select Module.
  3. Enter your module name (e.g., User).
  4. Choose the architecture (Simple or Modular).
  5. Choose whether to use an ORM or not.
  6. If choosing an ORM, select the desired ORM/Database.

rakitin will create the appropriate folder structure and files within your app/modules/user directory.

Project Structure

Here's an overview of the project structure created or interacted with by rakitin:

.
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ modules/          # Folder for your application modules
โ”‚   โ”‚   โ””โ”€โ”€ [module-name]/
โ”‚   โ”‚       โ”œโ”€โ”€ [module-name].controller.js (Simple Arch)
โ”‚   โ”‚       โ”œโ”€โ”€ [module-name].service.js (Simple Arch)
โ”‚   โ”‚       โ”œโ”€โ”€ [module-name].routes.js (Simple Arch)
โ”‚   โ”‚       โ””โ”€โ”€ controllers/ (Modular Arch)
โ”‚   โ”‚       โ””โ”€โ”€ services/ (Modular Arch)
โ”‚   โ”‚       โ””โ”€โ”€ models/ (Modular Arch)
โ”‚   โ”‚       โ””โ”€โ”€ routes/ (Modular Arch)
โ”‚   โ”œโ”€โ”€ shared/           # Folder for components shared between modules
โ”‚   โ”‚   โ”œโ”€โ”€ middlewares/  # Application middlewares
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ [middleware-name].middleware.js
โ”‚   โ”‚   โ”œโ”€โ”€ config/       # Configuration files
โ”‚   โ”‚   โ”œโ”€โ”€ utils/        # Utility files
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ [util-name].util.js
โ”‚   โ”‚   โ””โ”€โ”€ interfaces/   # Interface/type definitions (if any)
โ”‚   โ”œโ”€โ”€ app.js            # Express app initialization file
โ”‚   โ””โ”€โ”€ server.js         # Main application entry point
โ”œโ”€โ”€ bin/
โ”‚   โ””โ”€โ”€ rakitin.js        # CLI executable
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ generator/        # Logic for generating various features
โ”‚   โ”‚   โ”œโ”€โ”€ config/       # Config generator logic (Under Development)
โ”‚   โ”‚   โ”œโ”€โ”€ middleware/
โ”‚   โ”‚   โ”œโ”€โ”€ module/
โ”‚   โ”‚   โ”œโ”€โ”€ router/       # Main Router Integration generator logic (Under Development)
โ”‚   โ”‚   โ””โ”€โ”€ util/
โ”‚   โ”œโ”€โ”€ constants.js      # Constant path definitions
โ”‚   โ”œโ”€โ”€ prompt.js         # Interactive prompt logic
โ”‚   โ””โ”€โ”€ utils.js          # Internal CLI utility functions
โ”œโ”€โ”€ index.js              # Main CLI logic
โ”œโ”€โ”€ package.json          # Project metadata and dependencies
โ”œโ”€โ”€ package-lock.json     # Dependency resolution
โ””โ”€โ”€ .gitignore            # Files ignored by Git

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! If you have ideas or find bugs, please open an issue or submit a pull request.

Contact

Author: Reinvy