jwtmoshiur 1.0.0 → 1.0.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.
Files changed (3) hide show
  1. package/bin/cli.js +9 -5
  2. package/package.json +2 -1
  3. package/readme.md +16 -0
package/bin/cli.js CHANGED
@@ -1,6 +1,10 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
- const { initializeJwtMoshiur } = require('../dist/setup');
4
-
5
- console.log(' Initializing JWT Moshiur...');
6
- initializeJwtMoshiur();
3
+ try {
4
+ const { initializeJwtMoshiur } = require('../dist/setup');
5
+ console.log('\n 🔐 Initializing JWT Moshiur...\n');
6
+ initializeJwtMoshiur();
7
+ } catch (error) {
8
+ console.error(' Error during setup:', error.message);
9
+ process.exit(0); // Don't fail npm install if setup fails
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jwtmoshiur",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "JWT auto-setup package with token generation and verification",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,6 +9,7 @@
9
9
  },
10
10
  "scripts": {
11
11
  "build": "tsc",
12
+ "setup": "node bin/cli.js",
12
13
  "prepublishOnly": "npm run build",
13
14
  "postinstall": "node bin/cli.js"
14
15
  },
package/readme.md CHANGED
@@ -255,6 +255,22 @@ your-project/
255
255
 
256
256
  ## 🛠️ Troubleshooting
257
257
 
258
+ ### Issue: Auto setup not working after npm install
259
+ **Solution:** Manually run the setup command:
260
+ ```bash
261
+ npx jwtmoshiur
262
+ ```
263
+
264
+ Or if you're in the package, run:
265
+ ```bash
266
+ npm exec jwtmoshiur
267
+ ```
268
+
269
+ Or update to v1.0.1+:
270
+ ```bash
271
+ npm install jwtmoshiur@latest
272
+ ```
273
+
258
274
  ### Issue: Token generation fails
259
275
  **Solution:** Ensure `JWT_SECRET` is set in `.env`
260
276