nhb-toolbox 4.14.1 → 4.14.2
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/README.md +115 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,7 +57,18 @@
|
|
|
57
57
|
|
|
58
58
|
---
|
|
59
59
|
|
|
60
|
-
##
|
|
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nhb-toolbox",
|
|
3
|
-
"version": "4.14.
|
|
3
|
+
"version": "4.14.2",
|
|
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",
|