{"id":34656042,"url":"https://github.com/nazmul-nhb/nhb-scripts","last_synced_at":"2026-04-01T19:18:46.896Z","repository":{"id":293594426,"uuid":"984546657","full_name":"nazmul-nhb/nhb-scripts","owner":"nazmul-nhb","description":"A collection of custom Node.js scripts to use in TypeScript \u0026 JavaScript projects","archived":false,"fork":false,"pushed_at":"2025-12-16T06:38:18.000Z","size":553,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-28T00:58:06.805Z","etag":null,"topics":["cli","ecma-script","javascript","nodejs","script","scripts","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/nhb-scripts","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nazmul-nhb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-16T05:36:51.000Z","updated_at":"2025-12-16T06:37:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"b45e511e-ee88-462d-b25f-2658e573bb84","html_url":"https://github.com/nazmul-nhb/nhb-scripts","commit_stats":null,"previous_names":["nazmul-nhb/nhb-scripts"],"tags_count":114,"template":false,"template_full_name":null,"purl":"pkg:github/nazmul-nhb/nhb-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmul-nhb%2Fnhb-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmul-nhb%2Fnhb-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmul-nhb%2Fnhb-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmul-nhb%2Fnhb-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nazmul-nhb","download_url":"https://codeload.github.com/nazmul-nhb/nhb-scripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmul-nhb%2Fnhb-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","ecma-script","javascript","nodejs","script","scripts","typescript"],"created_at":"2025-12-24T18:01:42.926Z","updated_at":"2026-04-01T19:18:46.871Z","avatar_url":"https://github.com/nazmul-nhb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NHB Scripts\n\n\u003c!-- markdownlint-disable-file MD024 --\u003e\n\n\u003cp\u003e\n  \u003ca href=\"https://www.npmjs.com/package/nhb-scripts\" aria-label=\"Downloads\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/nhb-scripts.svg?label=DOWNLOADS\u0026style=flat\u0026color=red\u0026logo=npm\" alt=\"Downloads\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/nhb-scripts\" aria-label=\"Version\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/nhb-scripts.svg?label=nhb-scripts\u0026style=flat\u0026color=teal\u0026logo=npm\" alt=\"Latest Version\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- \u003ca href=\"https://bundlephobia.com/result?p=nhb-scripts\" aria-label=\"Bundle size\"\u003e\n    \u003cimg src=\"https://img.shields.io/bundlephobia/minzip/nhb-scripts?style=flat\u0026color=purple\u0026label=SIZE\u0026logo=nodedotjs\" alt=\"Bundle Size\" /\u003e\n  \u003c/a\u003e --\u003e\n  \u003ca href=\"https://www.npmjs.com/package/nhb-scripts\" aria-label=\"License\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/nhb-scripts.svg?label=LICENSE\u0026style=flat\u0026color=orange\u0026logo=open-source-initiative\" alt=\"License\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nA **developer-first toolkit** to automate common dev tasks in JavaScript/TypeScript projects. Built to reduce repetitive boilerplate and improve developer velocity — no magic, just clean logic.\n\n## Table of Contents\n\n- [⚡ Compatibility](#-compatibility)\n  - [✅ Requirements](#-requirements)\n- [⚙️ Unified Configuration System](#️-unified-configuration-system)\n- [🧰 Included CLI Scripts](#-included-cli-scripts)\n- [🔧 How to Use in Your Project](#-how-to-use-in-your-project)\n- [🧱 nhb-module — Module Generator](#-nhb-module--module-generator)\n  - [⚙️ Setup in package.json](#️-setup-in-packagejson)\n  - [🛠️ What It Does](#️-what-it-does)\n  - [📦 Pre-built Template](#-pre-built-template)\n  - [📁 Custom Template Support](#-custom-template-support)\n    - [🧠 Why dynamic files?](#-why-dynamic-files)\n    - [🗂️ Template Files files](#️-template-files-files)\n  - [💡 CLI Flags](#-cli-flags)\n  - [🤖 What Happens Behind the Scenes](#-what-happens-behind-the-scenes)\n  - [📁 Output Example](#-output-example)\n  - [🧩 Template Shape](#-template-shape)\n  - [🔄 Lifecycle Hooks Optional](#-lifecycle-hooks-optional)\n  - [🛑 Cancel or Abort](#-cancel-or-abort)\n- [🏗️ nhb-build — Customizable Build Runner with Progress Visualization](#️-nhb-build--customizable-build-runner-with-progress-visualization)\n  - [✨ Features](#-features)\n  - [⚙️ Configuration](#️-configuration)\n    - [🏗️ Options](#️-options)\n  - [📦 Usage](#-usage)\n  - [✅ Example Output](#-example-output)\n  - [🔧 Post‑Build Hooks](#-postbuild-hooks)\n- [📝 nhb-commit — Commit Version Updates with Semver \u0026 Custom Message](#-nhb-commit--commit-version-updates-with-semver--custom-message)\n  - [⚙️ Setup in package.json](#️-setup-in-packagejson-1)\n  - [🚦 What It Does](#-what-it-does)\n  - [✨ Commit Format](#-commit-format)\n  - [🧩 Supported Types Predefined Choices](#-supported-types-predefined-choices)\n  - [💬 Prompt Flow](#-prompt-flow)\n  - [🧪 Semver Validations](#-semver-validations)\n  - [🔧 Behavior Summary](#-behavior-summary)\n  - [⚙️ Configuration](#️-configuration-1)\n    - [📌 Available Options](#-available-options)\n  - [✨ Formatter Integration Prettier](#-formatter-integration-prettier)\n  - [📁 Optional Formatter Config](#-optional-formatter-config)\n  - [📦 Combined Flow](#-combined-flow)\n  - [🛑 Cancel or Abort](#-cancel-or-abort-1)\n- [🐕 nhb-husky - Setup Husky with Lint-Staged](#-nhb-husky---setup-husky-with-lint-staged)\n  - [📦 What It Does](#-what-it-does-1)\n- [🎨 nhb-format — Code Formatter Prettier Runner](#-nhb-format--code-formatter-prettier-runner)\n  - [⚙️ Setup in package.json](#️-setup-in-packagejson-2)\n  - [📦 What It Does](#-what-it-does-2)\n  - [🛠️ Example Config](#️-example-config)\n  - [🔄 Automatic Integration with nhb-commit](#-automatic-integration-with-nhb-commit)\n  - [⚠️ Requirements](#️-requirements)\n  - [📁 Output Example](#-output-example-1)\n- [✅ nhb-lint — ESLint Linter Runner](#-nhb-lint--eslint-linter-runner)\n  - [⚙️ Setup in package.json](#️-setup-in-packagejson-3)\n  - [✨ Features](#-features-1)\n  - [🛠️ Example Config](#️-example-config-1)\n  - [📦 Output Example](#-output-example-2)\n- [🔧 nhb-fix — ESLint Auto‑Fix Runner](#-nhb-fix--eslint-autofix-runner)\n  - [⚙️ Setup in package.json](#️-setup-in-packagejson-4)\n  - [✨ Features](#-features-2)\n  - [📦 Output Example](#-output-example-3)\n  - [⚙️ Configuration](#️-configuration-2)\n  - [💡 Pro Tips](#-pro-tips)\n- [📊 nhb-count — Export Counter CLI](#-nhb-count--export-counter-cli)\n  - [🔧 Usage](#-usage-1)\n  - [⚙️ Configuration](#️-configuration-3)\n  - [🧭 Interactive CLI Prompts](#-interactive-cli-prompts)\n  - [✅ Exactly What Happens](#-exactly-what-happens)\n  - [✅ Output Example](#-output-example-4)\n  - [📌 What It Detects](#-what-it-detects)\n  - [✅ Example](#-example)\n  - [🗑 nhb-delete – Interactive File \u0026 Folder Remover](#-nhb-delete--interactive-file--folder-remover)\n    - [🚀 Usage](#-usage-2)\n    - [✨ Features](#-features-3)\n    - [📌 Example](#-example-1)\n- [📄 License](#-license)\n\n\u003c!-- /TOC --\u003e\n\n## ⚡ Compatibility\n\n\u003cimg src=\"https://img.shields.io/badge/Node.js-Version%2022+-teal?style=flat\u0026logo=node.js\u0026logoColor=green\" alt=\"Node.js 22+\" /\u003e\n\n\u003e **Important:**  \n\u003e `nhb-scripts` is designed **only for Node.js environments** (v22 or later).  \n\u003e It is **not intended for browser environment**, so tools like [Bundlephobia](https://bundlephobia.com/) may report missing browser dependencies.  \n\u003e This is expected behavior and does **not** affect usage in `Node.js`.\n\n### ✅ Requirements\n\n- Node.js **22 or newer**  \n- `npm`, `pnpm`, or `yarn` for installation\n\n```bash\npnpm add -D nhb-scripts\n# or\nnpm install -D nhb-scripts\n# or\nyarn add -D nhb-scripts\n```\n\n---\n\n## ⚙️ Unified Configuration System\n\n\u003e Initialize configuration file by running the `nhb-init` command\n\n\u003cdetails\u003e\n  All scripts use a single configuration file `nhb.scripts.config.mjs` that is automatically created if not present. Available configuration options include:\n\n  \u003csummary\u003e\n   \u003cb\u003eDetails\u003c/b\u003e\n  \u003c/summary\u003e\n\n  ```js\n  // @ts-check\n\n  import { defineScriptConfig, expressMongooseZodTemplate } from 'nhb-scripts';\n\n  export default defineScriptConfig({\n      format: {\n          args: ['--write'],\n          files: ['.'],\n          ignorePath: '.prettierignore',\n      },\n      lint: { folders: ['src'], patterns: ['**/*.ts'] }, // Optional, these are defaults\n      fix: { folders: ['src'], patterns: ['**/*.ts'] }, // Optional, these are defaults\n      commit: {\n          /** Run Prettier formatter before committing. Default is `false`. */\n          runFormatter: true,\n          /** Pre-hook to run before commit and after version change. */\n          runBefore: () =\u003e {\n            // Your logic here\n          },\n          /** Post-hook to run after commit and/or push. */\n          runAfter: () =\u003e {\n            // Your logic here\n          },\n          /** Wrap the prefix with custom symbols or any string, e.g. `\"*\"` makes the prefix looks like `\"*type(scope):* your commit message\"`. Default is empty string. */\n          wrapPrefixWith: \"`\";\n          /** Whether to prepend the corresponding emoji before the commit type prefix (applied only for the default ones). Default is `false`. */\n          emojiBeforePrefix: true, // Omit `emojiBeforePrefix` to use default `false`.\n          /** Options for extending commit types */\n          commitTypes: {\n            /** Whether to override the default commit types. Defaults to `false` */\n            overrideDefaults?: false,\n            /** Array of custom commit types with emoji and type names */\n            custom: [\n              { emoji: '🏃‍♂️‍➡️', type: 'run' },\n              // more custom types\n            ]\n          },\n      },\n      count: {\n          defaultPath: '.', // default path to scan\n          excludePaths: ['node_modules', 'dist', 'build'] // folders to exclude\n      },\n      build: {\n        distFolder: 'dist', // optional, default: \"dist\"\n        deleteDist: true, // delete dist folder before each build, set `false` to keep dist folder intact\n        showOutputs: true, // display output file list, default is `false`\n        waitingMessage: ' 📦 Building Your Server...', // Message to display while build process is running\n        commands: [ // default is [{cmd: 'tsc'}]\n            // Not default\n            { cmd: 'tsc', args: ['-p', 'tsconfig.cjs.json'] },\n            // Not default\n            {\n                cmd: 'tsc',\n                args: ['-p', 'tsconfig.esm.json'],\n                options: { stdio: 'inherit' }\n            }\n        ],\n        after: [\n            // Not default\n            async () =\u003e await fixJsExtensions('dist/esm'),\n            // Not default\n            async () =\u003e await fixTypeExports({\n                distPath: 'dist/dts',\n                packageJsonPath: 'package.json',\n                typeFileCandidates: ['types.d.ts', 'interfaces.d.ts'],\n                extraPatterns: [\n                    { pattern: 'plugins', folderName: 'plugins' },\n                ],\n                extraStatic: {\n                    './types': {\n                        types: './dist/dts/types/index.d.ts',\n                        default: './dist/dts/types/index.d.ts'\n                    },\n                    './constants': {\n                        types: './dist/dts/constants.d.ts',\n                        import: './dist/esm/constants.js',\n                        require: './dist/cjs/constants.js'\n                    },\n                }\n            }),\n        ],\n      },\n      module: {\n          destination: 'src/modules', // optional, default: \"src/modules\"\n          defaultTemplate: 'my.template1', // selected by default, must match with the keys of `templates` object\n          force: false, // `true` if you want to override the existing module\n          templates: {\n              'express-mongoose-zod': {\n                  createFolder: true,\n                  destination: 'src/app/modules',\n                  files: expressMongooseZodTemplate // pre-built module : function that receives moduleName as argument and creates pre-defined files and contents\n              },\n              'my.template1': {\n                  createFolder: true, // if `false` does not create folder with the module name from cli\n                  destination: 'src/app', // optional, will prioritize inputs from cli\n                  // Use dynamic moduleName in filenames and contents\n                  files: (moduleName) =\u003e [\n                      { name: `${moduleName}.controllers.ts`, content: `// controllers for ${moduleName}` },\n                      { name: `${moduleName}.services.ts`, content: `// services for ${moduleName}` }\n                  ]\n              },\n              'my_template2': {\n                  destination: 'src/features', // optional, will prioritize inputs from cli\n                  // Use static file list with contents\n                  files: [\n                      { name: 'index.ts', content: '// content' },\n                      { name: 'dummy.js', content: '// dummy' }\n                  ]\n              },\n          },\n          // Optional hooks to inspect or execute something at the beginning or after the module generation\n          hooks: {\n              onGenerate(name) {\n                  console.log('➡️  Generating:', name);\n              },\n              onComplete(name) {\n                  console.log('✅ Complete:', name);\n              }\n          }\n      }\n  });\n  ```\n\n\u003c/details\u003e\n\n---\n\n## 🧰 Included CLI Scripts\n\n| Script                                                                            | Description                                                                                     |\n| --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |\n| `nhb-init`                                                                        | Initialize the config file.           |\n| [nhb-module](#-nhb-module--module-generator)                                      | Scaffold module (folder with files) (e.g., Express + Mongoose + Zod by default) with templates. |\n| [nhb-build](#️-nhb-build--customizable-build-runner-with-progress-visualization) | Customizable Build Runner with Progress Visualization.                                          |\n| [nhb-commit](#-nhb-commit--commit-version-updates-with-semver--custom-message)    | Generate a conventional commit message interactively with validation.                           |\n| [nhb-husky](#-nhb-husky---setup-husky-with-lint-staged)                           | Setup `husky` with `lint-staged` with `prettier` pre-commit hook.                               |\n| [nhb-format](#-nhb-format--code-formatter-prettier-runner)                        | Format code with `prettier`.                                                                    |\n| [nhb-lint](#-nhb-lint--eslint-linter-runner)                                      | Lint code with `eslint`.                                                                        |\n| [nhb-fix](#-nhb-fix--eslint-autofix-runner)                                       | Fix linting errors in code with `eslint`.                                                       |\n| [nhb-count](#-nhb-count--export-counter-cli)                                      | Count export declarations (default, named, aliased) in JS/TS files/folders.                     |\n| [nhb-delete](#-nhb-delete--interactive-file--folder-remover)                      | Interactive File(s)/Folder(s) Remover.                                                          |\n\n\u003e Most of the examples here are shown using `pnpm` as package manager, you can use other package managers like `npm` or `yarn` or others.\n\n---\n\n## 🔧 How to Use in Your Project\n\nAdd to your `devDependencies`:\n\n```bash\nyarn add -D nhb-scripts\n```\n\n```bash\npnpm add -D nhb-scripts\n```\n\n```bash\nnpm i -D nhb-scripts\n```\n\nThen in your `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"module\": \"nhb-module\",\n    \"commit\": \"nhb-commit\",\n    \"format\": \"nhb-format\",\n    \"count\": \"nhb-count\"\n  }\n}\n```\n\nNow run any script like:\n\n```bash\npnpm module      # 🧩 Generate a new module\npnpm commit      # ✅ Bump version \u0026 commit changes\npnpm format      # 🎨 Format code with prettier\npnpm count       # 📦 Count exports in files\n```\n\nOr without `package.json` setup:\n\n```bash\npnpm nhb-module      # 🧩 Generate a new module\npnpm nhb-commit      # ✅ Bump version \u0026 commit changes\npnpm nhb-format      # 🎨 Format code with prettier\npnpm nhb-count       # 📦 Count exports in files\n```\n\n\u003e Replace `pnpm` with `npm run` or `yarn` if you're using those instead.\n\n---\n\n## 🧱 `nhb-module` — Module Generator\n\nScaffold consistent, production-ready API modules in your codebase using prebuilt or custom-defined templates.\n\nThis CLI simplifies creating module directories and boilerplate files with optional configuration, hooks, and folder override logic.\n\n---\n\n### ⚙️ Setup in `package.json`\n\n```json\n{\n  \"scripts\": {\n    \"module\": \"nhb-module\"\n  }\n}\n```\n\nthen use via:\n\n```bash\npnpm module\n```\n\n```bash\nyarn module\n```\n\n```bash\nnpm run module\n```\n\nor directly use as:\n\n```bash\npnpm nhb-module\n```\n\n---\n\n### 🛠️ What It Does\n\n- Prompts for module name, destination, and template (unless passed as CLI flags).\n- Uses a **pre-built template** (`express-mongoose-zod` : imported function `expressMongooseZodTemplate`) or your **custom templates** via a config file.\n- Prevents overwriting by default unless `--force` is passed or set in config.\n- Allows lifecycle hooks: `onGenerate`, `onComplete`.\n\n---\n\n### 📦 Pre-built Template\n\n| Name                   | Description                                                                                                             |\n| ---------------------- | ----------------------------------------------------------------------------------------------------------------------- |\n| `express-mongoose-zod` | Basic Express route + Mongoose model + Zod schema generator (built-in : imported function `expressMongooseZodTemplate`) |\n\n---\n\n### 📁 Custom Template Support\n\nConfigure templates in `nhb.scripts.config.mjs`:\n\n```js\nmodule: {\n    destination: 'src/modules', // optional, default: \"src/modules\"\n    defaultTemplate: 'my.template1', // selected by default, must match with the keys of `templates` object\n    force: false, // `true` if you want to override the existing module\n    templates: {\n        'express-mongoose-zod': {\n            createFolder: true,\n            destination: 'src/app/modules',\n            files: expressMongooseZodTemplate // pre-built module : function that receives moduleName as argument and creates pre-defined files and contents\n        },\n        'my.template1': {\n            createFolder: true, // if `false` does not create folder with the module name from cli\n            destination: 'src/app', // optional, will prioritize inputs from cli\n            // Use dynamic moduleName in filenames and contents\n            files: (moduleName) =\u003e [\n                { name: `${moduleName}.controllers.ts`, content: `// controllers for ${moduleName}` },\n                { name: `${moduleName}.services.ts`, content: `// services for ${moduleName}` }\n            ],\n            // Runs before this specific module generation (Optional)\n            onGenerate(name) {\n                Stylog.ansi16('yellow').bold.log(`${name} Started!`);\n            },\n            // Runs after this specific module generation (Optional)\n            onComplete(name) {\n                Stylog.ansi16('green').bold.log(`${name} Completed!`);\n            },\n        },\n        'my_template2': {\n            destination: 'src/features', // optional, will prioritize inputs from cli\n            // Use static file list with contents\n            files: [\n                { name: 'index.ts', content: '// content' },\n                { name: 'dummy.js', content: '// dummy' }\n            ]\n        },\n    },\n    // Optional hooks to inspect or execute something at the beginning or after the module generation (runs for all templates)\n    hooks: {\n        onGenerate(name) {\n            console.log('➡️  Generating:', name);\n        },\n        onComplete(name) {\n            console.log('✅ Complete:', name);\n        }\n    }\n}\n```\n\n#### 🧠 Why dynamic `files()`?\n\n\u003e If your filenames or content need to reference the module name (e.g. `auth.controller.ts`), use the function form.\n\u003e It provides full flexibility for templates that depend on runtime values.\n\n#### 🗂️ Template Files (`files`)\n\nYou can provide either of the following:\n\n1. **Static array of file entries**:\n\n   ```js\n   files: [\n     { name: 'index.ts', content: '// content' },\n     { name: 'routes.ts', content: 'export const route = \"auth\";' },\n   ]\n   ```\n\n2. **Dynamic function (recommended for reusable templates)**:\n\n   ```js\n   files: (moduleName) =\u003e [\n     { name: `${moduleName}.controller.ts`, content: `// controller for ${moduleName}` },\n     { name: `${moduleName}.service.ts`, content: `// service for ${moduleName}` },\n   ]\n   ```\n\n\u003e 💡 **Note:** You can and should write actual code inside the `content` field using template strings — works with any language!\n\u003e 💡 **File names** (`name`) can include folders like `{ name: 'utils/helper.ts' }`. Folders will be auto-created if missing.\n---\n\n### 💡 CLI Flags\n\nYou can also generate modules non-interactively using CLI flags to streamline automation or scripting:\n\n| Flag              | Alias | Description                                  |\n| ----------------- | ----- | -------------------------------------------- |\n| `--name`          | `-n`  | Name of the module                           |\n| `--template`      | `-t`  | Template to use                              |\n| `--destination`   | `-d`  | Directory to generate module into            |\n| `--force`         | `-f`  | Overwrite existing module if already present |\n| `--create-folder` | `-cf` | Create folder for module (default: `true`)   |\n\nExample:\n\n```bash\n# Using full flags\npnpm module --name=user --template=basic-app --destination=src/features --force\n\n# Using full flags but without equal sign\npnpm module --name user --template basic-app --destination src/features --force\n\n# Using aliases\npnpm module -n auth -t express-mongoose-zod -d src/modules\n\n# Force overwrite if module exists\npnpm module -n blog -t express-mongoose-zod -d src/modules -f\n\n# With create folder flag\npnpm module --name=user --template=basic-app --destination=src/features --force --create-folder=false\n\n# Using aliases\npnpm module -n auth -t express-mongoose-zod -d src/modules -cf false\n```\n\n---\n\n### 🤖 What Happens Behind the Scenes\n\n1. 🔍 Looks for a config file (offers to create one if missing).\n2. 🧱 Asks for module name, template, and destination (or use flags).\n3. ⚙️ Merges CLI flags with config values.\n4. 🚧 Warns if module exists — prompts overwrite unless `--force`.\n5. 🏗️ Generates module files from the selected template.\n6. 🔁 Runs `onGenerate` and `onComplete` hooks if configured.\n\n---\n\n### 📁 Output Example\n\nGiven:\n\n```js\nmodule: {\n    destination: 'src/features',\n    customTemplates: {\n        'basic-app': {\n            files: (name) =\u003e [\n                { name: `${name}.ts`, content: `// module: ${name}` },\n                { name: `${name}.routes.ts`, content: `// routes for ${name}` }\n            ]\n        }\n    }\n}\n```\n\nRun:\n\n```bash\npnpm module -n user -t basic-app\n```\n\n**Result:**\n\n```text\nsrc/features/user/\n├── user.ts           → // module: user\n└── user.routes.ts    → // routes for user\n```\n\n---\n\n### 🧩 Template Shape\n\n```ts\ntype FileEntry = {\n  name: string;       // file path relative to the module dir\n  content: string;    // file contents\n};\n\ntype CustomTemplate = {\n  destination?: string;\n  files: FileEntry[] | ((moduleName: string) =\u003e FileEntry[]);\n};\n```\n\nYou can define multiple templates and dynamically select one at CLI prompt or via `--template`.\n\n---\n\n### 🔄 Lifecycle Hooks (Optional)\n\n| Hook         | Signature                      | Purpose                     |\n| ------------ | ------------------------------ | --------------------------- |\n| `onGenerate` | `(moduleName: string) =\u003e void` | Before writing module files |\n| `onComplete` | `(moduleName: string) =\u003e void` | After writing module files  |\n\n---\n\n### 🛑 Cancel or Abort\n\n- If a module already exists and `--force` is not used, the CLI prompts confirmation.\n- You can abort at any step via keyboard interrupt (`Ctrl+C` or `Esc` on prompts).\n\n---\n\n## 🏗️ `nhb-build` — Customizable Build Runner with Progress Visualization\n\nA configurable build runner with progress estimator that can execute your build commands in sequence (e.g., `tsc`, `rollup`, `vite`) and then run optional post‑build hooks like `fixTypeExports()` or `fixJsExtensions()`.\n\n### ✨ Features\n\n- ✅ Define any build commands in your `nhb.scripts.config.mjs` (defaults to `tsc`).\n- ✅ Dynamically add multiple commands with arguments and `execa` options.\n- ✅ Always cleans your specified dist folder (using `rimraf`) before each build to avoid conflicts. You can configure this behavior.\n- ✅ Run post‑build hooks (`after`) as an array of async functions (e.g., `fixJsExtensions('dist/esm')`).\n- ✅ Rich output: shows file sizes, count, and total build time.\n- ✅ Optionally shows output file list. Set `showOutputs: true` in the config to display the list of output files.\n\n---\n\n### ⚙️ Configuration\n\nAdd a `build` section in your `nhb.scripts.config.mjs`:\n\n```js\n// @ts-check\nimport { defineScriptConfig, fixJsExtensions, fixTypeExports} from 'nhb-scripts';\n\nexport default defineScriptConfig({\n  // Other configs...\n  build: {\n    distFolder: 'output', // optional, default: \"dist\"\n    deleteDist: true, // delete dist folder before each build, set `false` to keep dist folder intact\n    showOutputs: true, // display output file list, default is `false`\n    waitingMessage: ' 📦 Building Your Server...', // Message to display while build process is running\n    commands: [\n      { cmd: 'tsc', args: ['-p', 'tsconfig.cjs.json'] },\n      { cmd: 'tsc', args: ['-p', 'tsconfig.esm.json'], options: { stdio: 'inherit' } }\n    ],\n    after: [\n        async () =\u003e await fixJsExtensions('dist/esm'),\n        async () =\u003e await fixTypeExports({\n            distPath: 'dist/dts',\n            packageJsonPath: 'package.json',\n            typeFileCandidates: ['types.d.ts', 'interfaces.d.ts'],\n            extraPatterns: [\n                { pattern: 'plugins', folderName: 'plugins' },\n            ],\n            extraStatic: {\n                './types': {\n                    types: './dist/dts/types/index.d.ts',\n                    default: './dist/dts/types/index.d.ts'\n                },\n                './constants': {\n                    types: './dist/dts/constants.d.ts',\n                    import: './dist/esm/constants.js',\n                    require: './dist/cjs/constants.js'\n                },\n            }\n        }),\n    ],\n  }\n});\n```\n\n#### 🏗️ **Options**\n\n| Field            | Type                   | Default                               | Description                                     |\n| ---------------- | ---------------------- | ------------------------------------- | ----------------------------------------------- |\n| `distFolder`     | `string`               | `dist`                                | Output folder used for size reporting.          |\n| `deleteDist`     | `boolean`              | `true`                                | Whether to delete old output before each build. |\n| `showOutputs`    | `boolean`              | `false`                               | Whether to display the list of output files.    |\n| `waitingMessage` | `string`               | `' 📦 Building Your Application...'` | Message to display while building.              |\n| `commands`       | `Array\u003cBuildCommand\u003e`  | see below                             | Array of build commands.                        |\n| `after`          | `Array\u003cPromise\u003cvoid\u003e\u003e` | `[]`                                  | Hooks to run sequentially after build.          |\n\n**`BuildCommand` shape:**\n\n```ts\n{\n  cmd: string;           // executable to run (e.g. \"tsc\", \"rimraf\")\n  args?: string[];       // arguments for the command\n  options?: import('execa').Options; // additional execa options\n}\n```\n\n---\n\n### 📦 Usage\n\nAdd to `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"build\": \"nhb-build\"\n  }\n}\n```\n\nthen run via:\n\n```bash\npnpm build\n# or\nnpm run build\n# or\nyarn build\n```\n\nor directly use as:\n\n```bash\npnpm nhb-build\n```\n\n---\n\n### ✅ Example Output\n\n```md\n📦 Build Your Application\n─────────────────────────────────────────────\nBuilding Your Application...\n\n✓ Transformed Files:\n🟨 dist/esm/index.js                              3.20 kB\n🟦 dist/dts/index.d.ts                            0.45 kB\n🟩 dist/esm/index.js.map                          1.15 kB\n...\n✓ Total Files: 25; Total Size: 89.42 kB\n📦 Application was built in 3.27 seconds!\n```\n\n---\n\n### 🔧 Post‑Build Hooks\n\n`after` hooks run **after all build commands succeed**, in order.\nYou can pass any async function returning a Promise, for example:\n\n```js\n// @ts-check\n\nimport { fixJsExtensions, fixTypeExports} from 'nhb-scripts';\n\nexport default defineScriptConfig({\n  build: {\n    after: [\n        async () =\u003e await fixJsExtensions('dist/esm'),\n        async () =\u003e await fixTypeExports({\n            distPath: 'dist/dts',\n            packageJsonPath: 'package.json',\n            typeFileCandidates: ['types.d.ts', 'interfaces.d.ts'],\n            extraPatterns: [\n                { pattern: 'plugins', folderName: 'plugins' },\n            ],\n            extraStatic: {\n                './types': {\n                    types: './dist/dts/types/index.d.ts',\n                    default: './dist/dts/types/index.d.ts'\n                },\n                './constants': {\n                    types: './dist/dts/constants.d.ts',\n                    import: './dist/esm/constants.js',\n                    require: './dist/cjs/constants.js'\n                },\n            }\n        }),\n    ],\n  }\n});\n```\n\n---\n\n\u003e ✨ **Tip:** Because `nhb-build` uses `execa`, all commands respect your local environment and `cwd`, so you can run any build tools your project needs.\n\n---\n\n## 📝 `nhb-commit` — Commit Version Updates with Semver \u0026 Custom Message\n\nA simple, interactive CLI to:\n\n- Safely bump the package version (`package.json`)\n- Add a **conventional typed Git commit message** (with optional scope)\n- Automatically commit and push (will ask for permission to push to the remote repository)\n\nThis ensures your version bumps and commit messages are semver-valid, consistent, and expressive.\n\n---\n\n### ⚙️ Setup in `package.json`\n\n```json\n{\n  \"scripts\": {\n    \"commit\": \"nhb-commit\"\n  }\n}\n```\n\nthen run via:\n\n```bash\npnpm commit\n```\n\nor directly use as:\n\n```bash\npnpm nhb-commit\n```\n\n---\n\n### 🚦 What It Does\n\n1. Prompts for **new version** (or skip to use the current).\n2. Prompts for a **commit type** (e.g., `feat`, `fix`, `refactor`, etc.).\n3. Prompts optionally for a **scope** (e.g., `auth`, `ui`, etc.).\n4. Requires a **commit message**.\n5. Updates `package.json` version.\n6. Runs:\n\n   ```bash\n   git add .\n   git commit -m \"\u003ctype\u003e(\u003cscope\u003e): \u003cmessage\u003e\"\n   ```\n\n7. Ask for push permission (defaults to `Yes`).\n8. Runs:\n\n   ```bash\n   git push\n   ```\n\n---\n\n### ✨ Commit Format\n\n```bash\n\u003ctype\u003e(optional-scope): \u003cmessage\u003e\n```\n\nExamples:\n\n```text\nfeat(api): add user registration flow\nfix: resolve async deadlock issue\nrefactor(db): improve mongoose connection handling\n```\n\n---\n\n### 🧩 Supported Types (Predefined Choices)\n\n\u003e Default type: **`update`**\n\n| Type       | Description                          |\n| ---------- | ------------------------------------ |\n| `update`   | 🔧  General update (default)        |\n| `feat`     | ✨  New feature                     |\n| `fix`      | 🐛  Bug fix                         |\n| `chore`    | 🛠️  Maintenance task (e.g., deps)   |\n| `refactor` | 🧼  Internal logic change           |\n| `test`     | 🧪  Adding/fixing tests             |\n| `docs`     | 📚  Documentation-only change       |\n| `style`    | 💅  Code formatting, styling etc.   |\n| `perf`     | ⚡  Performance improvement         |\n| `ci`       | 🚀  CI-related changes              |\n| `build`    | 🧱  Build system changes            |\n| `revert`   | 🔁  Revert a previous commit        |\n| `release`  | 🔖  Version bump or release         |\n| `deps`     | 📦  Dependency updates              |\n| `cleanup`  | 🧹  Minor cleanup tasks             |\n| `merge`    | 🧭  Merge-related commits           |\n| `Custom`   | ✍️  Manually enter your own         |\n\n---\n\n### 💬 Prompt Flow\n\n```bash\n? Current version: 1.3.4\n? Enter new version (or press Enter to keep): 1.4.0\n? Select commit type: Predefined type or a custom one\n? Enter custom commit type: update/fix etc. or infra (whatever custom type you want)\n? Enter commit scope (optional): devops\n? Enter commit message (required): configure docker build\n\n✔ Commit message → infra(devops): configure docker build\n✔ Version updated to 1.4.0\n✔ Committed successfully \n? Ask for push permission (defaults to 'Yes')!\n✔ Pushed successfully!\n```\n\n---\n\n### 🧪 Semver Validations\n\n- Prevents invalid semver input\n- Ensures new version is **equal to or greater** than current\n- Allows skipping version bump by pressing `Enter`\n\n---\n\n### 🔧 Behavior Summary\n\n\u003e **Note:** Git must be installed, and your repository must be initialized with a remote named `origin`.\nThis is required because the script **automatically commits and pushes** version changes to your Git remote.\n\n| Step             | Behavior                                                                |\n| ---------------- | ----------------------------------------------------------------------- |\n| `version` prompt | Accepts semver (e.g., `1.2.3`, `2.0.0-beta.1`) or press `Enter` to skip |\n| `type` prompt    | Choose from predefined types or default (`update`)                      |\n| `scope` prompt   | Optional. If blank, excluded from final commit message                  |\n| `message` prompt | Required. Validates non-empty                                           |\n| `git` operations | Adds all changes, commits, pushes with composed message                 |\n\n\u003e You can also override or extend the default types + emojis from the configuration option `commitTypes`.\n\n---\n\n### ⚙️ Configuration\n\nIn `nhb.scripts.config.mjs`:\n\n```js\ncommit: {\n    runFormatter: false, // Set `true` to run Prettier before committing\n    /** Wrap the prefix with custom symbols or any string, e.g. \"*\" makes the prefix looks like \"*type(scope):* your commit message\". Default is empty string. */\n    wrapPrefixWith: \"`\";\n    /** Whether to prepend the corresponding emoji before the commit type prefix (applied only for the default ones). Default is `false`. */\n    emojiBeforePrefix: true, // Omit `emojiBeforePrefix` to use default `false`.\n    /** Pre-hook to run before commit and after version change. */\n    runBefore: () =\u003e {\n      console.log('Pre-hook is called...')\n    },\n    /** Post-hook to run after commit and/or push. */\n    runAfter: () =\u003e {\n      console.log('Post-hook is called...')\n    },\n    /** Options for extending commit types */\n    commitTypes: {\n      /** Whether to override the default commit types. Defaults to `false` */\n      overrideDefaults?: false,\n      /** Array of custom commit types with emoji and type names */\n      custom: [\n        { emoji: '🏃‍♂️‍➡️', type: 'run' },\n        // more custom types\n      ]\n    }\n}\n```\n\n---\n\n#### 📌 Available Options\n\n| Option              | Type     | Default     | Description                                                                   |\n| ------------------- | -------- | ----------- | ----------------------------------------------------------------------------- |\n| `runFormatter`      | boolean  | `false`     | Whether to **automatically run Prettier** before committing.                  |\n| `runBefore`         | Function | `undefined` | Whether to **automatically run pre-hook** before committing.                  |\n| `runAfter`          | Function | `undefined` | Whether to **automatically run post-hook** after committing.                  |\n| `wrapPrefixWith`    | string   | `\"\"`        | **Wrap** *the prefix with custom symbols or any string.*                      |\n| `emojiBeforePrefix` | boolean  | `false`     | Whether to **prepend the corresponding emoji before the commit type prefix**. |\n\n---\n\n### ✨ Formatter Integration (Prettier)\n\nIf `runFormatter: true` is enabled in the config:\n\n- It **ensures** `.prettierrc.json` and `.prettierignore` exist.\n- It runs `prettier --write .` or customized options from `nhb.format.config.mjs` (if present) **before** staging changes.\n\n\u003e 💡 This ensures your code is always formatted before being committed!\n\n---\n\n### 📁 Optional Formatter Config\n\nYou can also define a custom formatter config.\n\nPlease refer to [nhb-format](#-nhb-format--code-formatter-prettier-runner) for details.\n\n\u003e If you prefer `husky` and `lint-staged` follow the [instructions here](#-nhb-husky---setup-husky-with-lint-staged).\n\n---\n\n### 📦 Combined Flow\n\nIf both configs are present and `runFormatter` is `true`, `nhb-commit` will:\n\n1. Load your `nhb.format.config.mjs` (if available).\n2. Run Prettier formatting.\n3. Proceed to version update and Git commit.\n\n---\n\n### 🛑 Cancel or Abort\n\nYou can abort at any time using `Ctrl+C` or `Esc`.\n\n---\n\n## 🐕 `nhb-husky` - Setup Husky with Lint-Staged\n\nSetup `husky` with `lint-staged` with `prettier` pre-commit hook quickly.\n\n\u003e If you use husky with lint-staged make sure to set `runFormatter: false` in `nhb.scripts.config.mjs` file:\n\n```js\ncommit: {\n    runFormatter: false,\n}\n```\n\ndirectly run:\n\n```bash\npnpm nhb-husky\n```\n\n### 📦 What It Does\n\n1. Installs `husky` and `lint-staged` if not installed already.\n2. Configures `.husky/pre-commit` file with proper `lint-staged` setup.\n3. Creates `.lintstagedrc.json` file with following config:\n\n    ```json\n    {\n      \"*.+((c|m)?js(x)?|(c|m)?ts(x)?)\": [\n        \"prettier --write\"\n      ]\n    }\n    ```\n\n    \u003e If `.lintstagedrc.json` file already exists, it skips creating this file.\n\n\u003e For further configuration for these files, please refer to their official docs: [husky](https://typicode.github.io/husky/) and [lint-staged](https://www.npmjs.com/package/lint-staged)\n\n---\n\n## 🎨 `nhb-format` — Code Formatter (Prettier Runner)\n\nA script that ensures clean and consistent formatting using **Prettier**, with optional config and auto-scaffolding support.\n\n---\n\n### ⚙️ Setup in `package.json`\n\n```json\n{\n  \"scripts\": {\n    \"format\": \"nhb-format\"\n  }\n}\n```\n\nthen run it via:\n\n```bash\npnpm format\n```\n\nor directly use as:\n\n```bash\npnpm nhb-format\n```\n\n---\n\n### 📦 What It Does\n\n1. Ensures `.prettierrc.json` and `.prettierignore` exist in the project root (auto-generates if missing).\n2. Loads user config from:\n\n   - `nhb.scripts.config.mjs` or\n   - `nhb.scripts.config.js`\n3. Executes Prettier with the defined args/files.\n\n\u003e 💡 If no config file exists, it runs Prettier with default args: `--write .`\n\n---\n\n### 🛠️ Example Config\n\nUpdate format1 property in `nhb.scripts.config.mjs` file:\n\n```js\nformat: {\n    args: ['--write'],\n    files: ['src', 'lib'],\n    ignorePath: '.prettierignore'\n}\n```\n\n---\n\n### 🔄 Automatic Integration with `nhb-commit`\n\nIf `runFormatter: true` is set in your `nhb.commit.config.mjs`, the formatter will be triggered **before committing**.\nSee [nhb-commit](#-nhb-commit--commit-version-updates-with-semver--custom-message) for more details.\n\n---\n\n### ⚠️ Requirements\n\nMake sure `prettier` is installed in your `dependencies` or `devDependencies`:\n\n```bash\npnpm add -D prettier\n```\n\nIf missing, the script will exit with a warning and suggest installation.\n\n---\n\n### 📁 Output Example\n\n```bash\npnpm format\n\n🎨 Running Prettier...\n\n# Scanned file-list\n\n✅ Prettier formatting complete!\n```\n\n---\n\n## ✅ `nhb-lint` — ESLint Linter Runner\n\nRun ESLint across your project with a unified configuration system.\nIt **automatically detects your folders and patterns** from `nhb.scripts.config.mjs` and shows a **detailed lint summary** with all issues.\n\n### ⚙️ Setup in `package.json`\n\n```json\n{\n  \"scripts\": {\n    \"lint\": \"nhb-lint\"\n  }\n}\n```\n\nthen run via:\n\n```bash\npnpm lint\n# or\nnpm run lint\n# or\nyarn lint\n```\n\nor directly use as:\n\n```bash\npnpm nhb-lint\n```\n\n---\n\n### ✨ Features\n\n- ✅ Auto‑detects and ensures ESLint configuration (`.eslintrc.cjs` etc.)\n- ✅ Loads lint config (`folders`, `patterns`) from `nhb.scripts.config.mjs`\n- ✅ Rich output with a **bullet‑point summary** of all ESLint findings\n- ✅ Shows scanned file count and total runtime\n- ✅ Works with TypeScript \u0026 JavaScript projects (ESM only)\n\n---\n\n### 🛠️ Example Config\n\nIn `nhb.scripts.config.mjs`:\n\n```js\nlint: {\n  folders: ['src', 'tests'],        // optional; default: [\"src\"]\n  patterns: ['**/*.ts', '**/*.tsx'] // optional; default: [\"**/*.ts\"]\n}\n```\n\n---\n\n### 📦 Output Example\n\n```bash\n🚀 Run ESLint Linter\n⏳ Linting Your Code in src, tests...\n\n✓ Lint Summary\n • src/index.ts:12:3  warning  Unexpected console statement  no-console\n • src/utils/helpers.ts:45:10  error  Missing return type on function  @typescript-eslint/explicit-module-boundary-types\n • tests/app.spec.ts:5:1  error  Prefer const over let  prefer-const\n\n✓ Scanned total 58 files in 2.43 seconds!\n🎉 Linting completed in folders: src, tests\n```\n\n---\n\n## 🔧 `nhb-fix` — ESLint Auto‑Fix Runner\n\nRun ESLint with the `--fix` flag to **automatically fix** many common issues in your code.\n\n### ⚙️ Setup in `package.json`\n\n```json\n{\n  \"scripts\": {\n    \"fix\": \"nhb-fix\"\n  }\n}\n```\n\nthen run via:\n\n```bash\npnpm fix\n# or\nnpm run fix\n# or\nyarn fix\n```\n\nor directly use as:\n\n```bash\npnpm nhb-fix\n```\n\n---\n\n### ✨ Features\n\n- ✅ Same detection and configuration as `nhb-lint`\n- ✅ Applies **auto‑fixable** rules (formatting, unused vars, etc.)\n- ✅ Shows a **fix summary** with all changes applied\n- ✅ Counts scanned files and shows runtime\n\n---\n\n### 📦 Output Example\n\n```bash\n🚀 Run ESLint Linter\n⏳ Fixing Your Code in src...\n\n✓ Fix Summary\n • src/utils/array.ts:12:1  fixed  Remove unused import\n • src/components/Button.tsx:5:1  fixed  Format JSX spacing\n\n✓ Scanned total 58 files in 2.02 seconds!\n🎉 Fixing completed in folders: src\n```\n\n---\n\n### ⚙️ Configuration\n\n`nhb-fix` use the `fix` section in `nhb.scripts.config.mjs`:\n\n```js\nfix: {\n  folders: ['src'],        // Folders to lint\n  patterns: ['**/*.ts']    // Glob patterns per folder\n}\n```\n\n---\n\n### 💡 Pro Tips\n\n- Run `pnpm lint` before pushing to catch errors early.\n- Run `pnpm fix` to automatically resolve fixable issues.\n- Combine with `nhb-commit` (`runFormatter` option) for a fully automated commit pipeline.\n\n---\n\n## 📊 `nhb-count` — Export Counter CLI\n\nAnalyze the structure of JavaScript/TypeScript modules to detect and count:\n\n- Default exports\n- Named exports\n- Aliased named exports\n- Type-only named exports (`export type { ... }`)\n\n\u003e ⚠ Only supports files that use **ES-style exports** (`export`, `export default`). *CommonJS-style* (`module.exports`, `exports.foo`) is not currently counted.\n\n---\n\n### 🔧 Usage\n\n```bash\npnpm count\n```\n\n\u003e **Note:** This must be configured in your `package.json` scripts:\n\n ```json\n {\n   \"scripts\": {\n     \"count\": \"nhb-count\"\n   }\n }\n ```\n\nthen run via:\n\n```bash\npnpm count\n```\n\nor directly use as:\n\n```bash\npnpm nhb-count\n```\n\n---\n\n### ⚙️ Configuration\n\nIn `nhb.scripts.config.mjs`:\n\n```js\ncount: {\n    defaultPath: '.', // Default path when no input is provided\n    excludePaths: [   // Directories automatically excluded\n        'node_modules',\n        'dist', \n        'build'\n    ]\n}\n```\n\n### 🧭 Interactive CLI Prompts\n\nWhen executed, the script will prompt you:\n\n```bash\n📂 Export Counter\n───────────────────────────────────────────────────────────────────────────────-----\n🎯 Please specify the path to a \"js/ts/mjs\" file or folder containing \"js/ts/mjs\" files.\n   - Enter file path (with extension) to analyze one file\n   - Enter folder path to scan recursively\n   - Press Enter to use default path: [shows configured defaultPath]\n```\n\n### ✅ Exactly What Happens\n\n1. If you **enter a file path**:\n   - Must be `.js`, `.ts`, or `.mjs`\n   - Analyzes only that file\n\n2. If you **enter a folder path**:\n   - Recursively scans for matching files\n   - Automatically excludes `node_modules`, `dist`, `build`\n   - Respects additional `excludePaths` from config\n\n3. If you **press Enter**:\n   - Uses `defaultPath` from config (defaults to `.`)\n\n### ✅ Output Example\n\n```bash\n📦 Export Summary for \"src/utils/math.ts\":\n🔸 Default Exports         : 1\n🔹 Named Exports (Total)   : 5\n   ┣ Direct                : 3\n   ┗ Aliased               : 2 \n🔺 Total Type Exports      : 4\n```\n\nKey Notes:\n\n- No command-line arguments accepted\n- Path must be entered interactively\n- Default path comes from config\n- Exclusion rules are automatic\n\n---\n\n### 📌 What It Detects\n\n| Count Type            | Description                                                        |\n| --------------------- | ------------------------------------------------------------------ |\n| `default`             | Number of `export default` statements                              |\n| `namedExportsTotal`   | Total `export { x, y as z }` style exports, including aliased ones |\n| `namedExportsDirect`  | Named exports without aliases (e.g., `export { foo }`)             |\n| `namedExportsAliased` | Named exports using `as` keyword (e.g., `export { foo as bar }`)   |\n| `namedTypeExports`    | Type-only exports (e.g., `export type { MyType }`)                 |\n\n---\n\n### ✅ Example\n\nGiven this file:\n\n```ts\nexport default function main() {}\nexport const foo = 42;\nexport { bar as renamedBar };\nexport type { SomeType };\n```\n\nOutput:\n\n```bash\n📦 Export Summary for \"some/file.ts\":\n🔸 Default Exports        : 1\n🔹 Named Exports (Total)  : 2\n   ┣ Direct               : 1\n   ┗ Aliased              : 1\n🔺 Total Type Exports     : 1\n```\n\n---\n\n### 🗑 `nhb-delete` – Interactive File \u0026 Folder Remover\n\nSafely clean up your project with a guided, prompt‑driven experience to browse and delete files or directories.\n\n\u003e Deleting large or deeply nested folders from VS Code often takes a long time or fails unexpectedly — `nhb-delete` offers a faster and more reliable solution.\n\n✅ Navigate into sub-folders or go back anytime  \n✅ Multi‑select files and folders for deletion  \n✅ Empty folders immediately prompt for deletion  \n✅ Skips opening truly empty directories\n\n#### 🚀 Usage\n\n\u003e **Note:** This must be configured in your `package.json` scripts:\n\n ```json\n {\n   \"scripts\": {\n     \"delete\": \"nhb-delete\"\n   }\n }\n ```\n\nthen run via:\n\n```bash\npnpm delete\n```\n\nor directly use as:\n\n```bash\npnpm nhb-delete\n```\n\n#### ✨ Features\n\n- **Interactive navigation:** step through your folders with clear prompts.\n- **Smart listings:** if only files exist, jump straight to multi‑select.\n- **Empty folder handling:** offers deletion instead of opening.\n- **Safe confirmation:** always double‑checks before removal.\n\n#### 📌 Example\n\n```bash\n🗑 Delete Directory/File(s)\n? Enter a base path or choose current directory ›\n❯ 📂 Current Directory\n  ✏️  Enter manually\n```\n\nUse **Space** to select and **Enter** to confirm — perfect for cleaning up scaffolds, build artifacts, or leftover files.\n\n---\n\n\u003e Built with ❤️ to make developer lives easier – because every second saved is a second earned.\n\n## 📄 License\n\n[MIT](LICENSE) © [Nazmul Hassan](mailto:nazmulnhb@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazmul-nhb%2Fnhb-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnazmul-nhb%2Fnhb-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazmul-nhb%2Fnhb-scripts/lists"}