nhb-toolbox 4.14.1 → 4.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ All notable changes to the package will be documented here.
6
6
 
7
7
  ---
8
8
 
9
+ ## [4.14.1-3] - 2025-08-11 - 2025-08-12
10
+
11
+ - **Updated** JSDoc, dev dependencies and **fixed** minor issues.
12
+
9
13
  ## [4.14.0] - 2025-08-11
10
14
 
11
15
  - **Added** new class `HttpStatus` for retrieving and managing HTTP status codes.
package/README.md CHANGED
@@ -57,7 +57,18 @@
57
57
 
58
58
  ---
59
59
 
60
- ## Install
60
+ ## Installation
61
+
62
+ `nhb-toolbox` is published to two package registries:
63
+
64
+ - **NPM Registry** (default public registry)
65
+ - **GitHub Packages** (GitHub’s package registry, scoped package)
66
+
67
+ ---
68
+
69
+ ### Installing from NPM Registry (default)
70
+
71
+ This is the simplest way to install and requires no additional setup.
61
72
 
62
73
  Choose your preferred package manager:
63
74
 
@@ -73,6 +84,109 @@ pnpm add nhb-toolbox
73
84
  yarn add nhb-toolbox
74
85
  ```
75
86
 
87
+ > Use this if you want the stable public version without extra config.
88
+
89
+ ---
90
+
91
+ <details>
92
+
93
+ <summary>
94
+
95
+ ### Installing from GitHub Packages
96
+
97
+ </summary>
98
+
99
+ GitHub Packages requires authentication and scoped package names.
100
+
101
+ #### Step 1: Authenticate with GitHub Packages
102
+
103
+ Create or use a **GitHub Personal Access Token (PAT)** with `read:packages` permission.
104
+
105
+ Add the following to your project’s `.npmrc` file (create if it doesn’t exist):
106
+
107
+ ```ini
108
+ @nazmul-nhb:registry=https://npm.pkg.github.com
109
+ //npm.pkg.github.com/:_authToken=YOUR_GITHUB_PERSONAL_ACCESS_TOKEN
110
+ ```
111
+
112
+ > Replace `YOUR_GITHUB_PERSONAL_ACCESS_TOKEN` with your actual token.
113
+
114
+ #### Step 2: Install the package with scoped name
115
+
116
+ Choose your preferred package manager:
117
+
118
+ ```shell
119
+ npm i @nazmul-nhb/nhb-toolbox
120
+ ```
121
+
122
+ ```shell
123
+ pnpm add @nazmul-nhb/nhb-toolbox
124
+ ```
125
+
126
+ ```shell
127
+ yarn add @nazmul-nhb/nhb-toolbox
128
+ ```
129
+
130
+ ---
131
+
132
+ #### Where do consumers get the GitHub token?
133
+
134
+ - **The token is personal and private** — *each consumer must create own*.
135
+
136
+ - Your **GitHub Personal Access Token (PAT)** **should never be shared publicly or with consumers**.
137
+
138
+ ---
139
+
140
+ #### How consumers create own token
141
+
142
+ 1. **Go to GitHub account settings** → **Developer settings** → **Personal access tokens** → **Tokens (classic)**.
143
+
144
+ 2. Click **Generate new token**, then:
145
+
146
+ - Give it a name (e.g., `npm package read access`).
147
+
148
+ - Set expiration as prefer.
149
+
150
+ - **Enable only the `read:packages` permission** (to allow reading packages).
151
+
152
+ 3. Generate the token and **copy it immediately** — won't see it again.
153
+
154
+ ---
155
+
156
+ #### What should consumers do with the token?
157
+
158
+ - Add it to `.npmrc` file (or environment) to authenticate with GitHub Packages.
159
+
160
+ Example `.npmrc` snippet:
161
+
162
+ ```ini
163
+ @nazmul-nhb:registry=https://npm.pkg.github.com
164
+ //npm.pkg.github.com/:_authToken=PERSONAL_ACCESS_TOKEN_HERE
165
+ ```
166
+
167
+ </details>
168
+
169
+ ---
170
+
171
+ ### Summary
172
+
173
+ | Registry | Package Name | Registry URL | Requires Auth? |
174
+ | --------------- | ------------------------- | -------------------------------------------------------- | ------------------------------ |
175
+ | NPM Registry | `nhb-toolbox` | [https://registry.npmjs.org](https://registry.npmjs.org) | No |
176
+ | GitHub Packages | `@nazmul-nhb/nhb-toolbox` | [https://npm.pkg.github.com](https://npm.pkg.github.com) | Yes (PAT with `read:packages`) |
177
+
178
+ ---
179
+
180
+ If you want to use both, just configure `.npmrc` accordingly and install the appropriate package name depending on your needs.
181
+
182
+ ---
183
+
184
+ ### Notes
185
+
186
+ - The GitHub Packages version may include pre-release or private builds.
187
+ - NPM Registry version is the recommended default for most users.
188
+ - You can safely use either registry depending on your environment.
189
+
76
190
  ---
77
191
 
78
192
  ## Changelog
@@ -8,10 +8,10 @@ const constants_1 = require("./constants");
8
8
  * @remarks
9
9
  * - Supports lookup by code or name (both `SOME_NAME` and `Some Name` formats).
10
10
  * - Allows adding custom codes and overriding messages for existing ones.
11
- * - Provides pre-grouped categories for quick filtering (see {@link HttpStatus.Groups}).
11
+ * - Provides pre-grouped categories for quick filtering (see {@link https://nhb-toolbox.vercel.app/docs/classes/HttpStatus#groups-static-property HttpStatus.Groups}).
12
12
  * - Intended to be reusable — create multiple instances if you want separate registries.
13
13
  *
14
- * @see {@link httpStatus} for the default preloaded singleton instance.
14
+ * @see {@link https://nhb-toolbox.vercel.app/docs/utilities/misc/httpStatus httpStatus} for the default preloaded singleton instance.
15
15
  *
16
16
  * @example
17
17
  * ```ts
@@ -135,7 +135,7 @@ class HttpStatus {
135
135
  }
136
136
  exports.HttpStatus = HttpStatus;
137
137
  /**
138
- * * Default singleton instance of {@link HttpStatus} class.
138
+ * * Default singleton instance of {@link https://nhb-toolbox.vercel.app/docs/classes/HttpStatus HttpStatus} class.
139
139
  *
140
140
  * @remarks
141
141
  * - Preloaded with all MDN-based HTTP status codes.
@@ -5,10 +5,10 @@ import type { HttpStatusName, StatusCategory, StatusCode, StatusEntry } from './
5
5
  * @remarks
6
6
  * - Supports lookup by code or name (both `SOME_NAME` and `Some Name` formats).
7
7
  * - Allows adding custom codes and overriding messages for existing ones.
8
- * - Provides pre-grouped categories for quick filtering (see {@link HttpStatus.Groups}).
8
+ * - Provides pre-grouped categories for quick filtering (see {@link https://nhb-toolbox.vercel.app/docs/classes/HttpStatus#groups-static-property HttpStatus.Groups}).
9
9
  * - Intended to be reusable — create multiple instances if you want separate registries.
10
10
  *
11
- * @see {@link httpStatus} for the default preloaded singleton instance.
11
+ * @see {@link https://nhb-toolbox.vercel.app/docs/utilities/misc/httpStatus httpStatus} for the default preloaded singleton instance.
12
12
  *
13
13
  * @example
14
14
  * ```ts
@@ -80,7 +80,7 @@ export declare class HttpStatus {
80
80
  list(category?: StatusCategory): StatusEntry[];
81
81
  }
82
82
  /**
83
- * * Default singleton instance of {@link HttpStatus} class.
83
+ * * Default singleton instance of {@link https://nhb-toolbox.vercel.app/docs/classes/HttpStatus HttpStatus} class.
84
84
  *
85
85
  * @remarks
86
86
  * - Preloaded with all MDN-based HTTP status codes.
@@ -5,10 +5,10 @@ import { HTTP_STATUS_DATA } from './constants.js';
5
5
  * @remarks
6
6
  * - Supports lookup by code or name (both `SOME_NAME` and `Some Name` formats).
7
7
  * - Allows adding custom codes and overriding messages for existing ones.
8
- * - Provides pre-grouped categories for quick filtering (see {@link HttpStatus.Groups}).
8
+ * - Provides pre-grouped categories for quick filtering (see {@link https://nhb-toolbox.vercel.app/docs/classes/HttpStatus#groups-static-property HttpStatus.Groups}).
9
9
  * - Intended to be reusable — create multiple instances if you want separate registries.
10
10
  *
11
- * @see {@link httpStatus} for the default preloaded singleton instance.
11
+ * @see {@link https://nhb-toolbox.vercel.app/docs/utilities/misc/httpStatus httpStatus} for the default preloaded singleton instance.
12
12
  *
13
13
  * @example
14
14
  * ```ts
@@ -131,7 +131,7 @@ export class HttpStatus {
131
131
  }
132
132
  }
133
133
  /**
134
- * * Default singleton instance of {@link HttpStatus} class.
134
+ * * Default singleton instance of {@link https://nhb-toolbox.vercel.app/docs/classes/HttpStatus HttpStatus} class.
135
135
  *
136
136
  * @remarks
137
137
  * - Preloaded with all MDN-based HTTP status codes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "4.14.1",
3
+ "version": "4.14.3",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions and classes for everyday development needs.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -38,23 +38,23 @@
38
38
  },
39
39
  "license": "Apache-2.0",
40
40
  "devDependencies": {
41
- "@eslint/js": "^9.28.0",
42
- "@types/jest": "^29.5.14",
43
- "@types/node": "^22.15.30",
44
- "@typescript-eslint/eslint-plugin": "^8.33.1",
45
- "@typescript-eslint/parser": "^8.33.1",
46
- "eslint": "^9.28.0",
47
- "eslint-config-prettier": "^10.1.5",
48
- "eslint-plugin-prettier": "^5.4.1",
49
- "globals": "^16.2.0",
41
+ "@eslint/js": "^9.33.0",
42
+ "@types/jest": "^30.0.0",
43
+ "@types/node": "^24.2.1",
44
+ "@typescript-eslint/eslint-plugin": "^8.39.0",
45
+ "@typescript-eslint/parser": "^8.39.0",
46
+ "eslint": "^9.33.0",
47
+ "eslint-config-prettier": "^10.1.8",
48
+ "eslint-plugin-prettier": "^5.5.4",
49
+ "globals": "^16.3.0",
50
50
  "husky": "^9.1.7",
51
- "jest": "^29.7.0",
52
- "lint-staged": "^16.1.4",
53
- "nhb-scripts": "^1.8.51",
54
- "prettier": "^3.5.3",
55
- "ts-jest": "^29.3.4",
56
- "typescript": "^5.8.3",
57
- "typescript-eslint": "^8.33.1"
51
+ "jest": "^30.0.5",
52
+ "lint-staged": "^16.1.5",
53
+ "nhb-scripts": "^1.8.54",
54
+ "prettier": "^3.6.2",
55
+ "ts-jest": "^29.4.1",
56
+ "typescript": "^5.9.2",
57
+ "typescript-eslint": "^8.39.0"
58
58
  },
59
59
  "keywords": [
60
60
  "toolbox",