node-auth-kit 1.0.2 β†’ 1.0.4

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 (2) hide show
  1. package/README.md +25 -25
  2. package/package.json +18 -10
package/README.md CHANGED
@@ -1,46 +1,46 @@
1
- πŸ” # Device Auth
1
+ # node-auth-kit
2
2
 
3
- Device Auth is a **Devise-inspired authentication and authorization library for Node.js**.
3
+ node-auth-kit is a **Devise-inspired authentication and authorization library for Node.js**.
4
4
 
5
- It gives you:
5
+ It provides **JWT authentication**, **role-based authorization**, and an **adapter-based architecture** so you can plug in MongoDB (Mongoose), Prisma, or other databases without rewriting auth logic.
6
6
 
7
- - **Config-driven auth** (email + password, roles, JWT, password rules)
8
- - **Plug-and-play Express routes** via `createAuthRouter`
9
- - **JWT-based security** with `authenticate` middleware
10
- - **Role-based authorization** with `authorize`
11
- - **Database-agnostic adapter system** (`mongooseAdapter`, future Prisma, etc.)
12
- - **Lifecycle hooks** (before/after register/login) for side effects
13
-
14
- You bring your framework (Express) and database (Mongo, Prisma, SQL). Device Auth handles the rest.
7
+ If you’re tired of rebuilding authentication for every Express app, **node-auth-kit gives you clean defaults with full control**.
15
8
 
16
9
  ---
17
10
 
18
- ## ✨ Features
11
+ ## Why node-auth-kit?
12
+
13
+ Most Node.js authentication libraries are either:
14
+ - too low-level, or
15
+ - tightly coupled to a specific ORM
16
+
17
+ node-auth-kit is inspired by Ruby on Rails **Devise** and focuses on:
19
18
 
20
- - **βœ… JWT Authentication (Access Tokens)**
21
- - **πŸ”‘ Role-based Authorization**
22
- - **🧩 Adapter Pattern (DB-agnostic)**
23
- - **πŸš€ Ready-to-use Express routes** via `createAuthRouter`
24
- - **πŸ”’ Secure password hashing**
25
- - **πŸ“¦ Mongoose adapter (Stable)**
26
- - **πŸ§ͺ Prisma adapter (In progress – V2)**
27
- - **🧠 Inspired by Ruby on Rails Devise**
19
+ - πŸ” JWT-based authentication for Express
20
+ - 🧩 Adapter-based database support (DB-agnostic core)
21
+ - πŸ”‘ Role-based authorization
22
+ - βš™οΈ Config-driven setup with sensible defaults
23
+ - 🧠 Extensible hooks for real-world needs
24
+
25
+ You bring **Express** and your **database**.
26
+ node-auth-kit handles authentication, authorization, and security patterns.
28
27
 
29
28
  ---
30
29
 
30
+
31
31
  ## πŸ“¦ Installation
32
32
 
33
33
  ```bash
34
- npm install device_auth
34
+ npm i node-auth-kit
35
35
  ```
36
36
 
37
37
  or
38
38
 
39
39
  ```bash
40
- yarn add device_auth
40
+ yarn add node-auth-kit
41
41
  ```
42
42
 
43
- `device_auth` itself is DB-agnostic. Database drivers / ORMs are **optional** and only required if you use the corresponding adapter:
43
+ `node-auth-kit` itself is DB-agnostic. Database drivers / ORMs are **optional** and only required if you use the corresponding adapter:
44
44
 
45
45
  - For Mongoose adapter: `mongoose`
46
46
  - For Prisma adapter (V2): `@prisma/client`
@@ -221,7 +221,7 @@ The public exports you can use:
221
221
  The central entry point is `deviceAuth`:
222
222
 
223
223
  ```ts
224
- import { deviceAuth, defaultConfig } from 'device_auth';
224
+ import { deviceAuth, defaultConfig } from 'node-auth-kit';
225
225
 
226
226
  deviceAuth.init({
227
227
  ...defaultConfig,
@@ -267,7 +267,7 @@ Supported hook names:
267
267
  Register hooks on `deviceAuth`:
268
268
 
269
269
  ```ts
270
- import { deviceAuth } from 'device_auth';
270
+ import { deviceAuth } from 'node-auth-kit';
271
271
 
272
272
  deviceAuth
273
273
  .registerHook('beforeRegister', async (createData) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "node-auth-kit",
3
- "version": "1.0.2",
4
- "description": "Device-based authentication and authorization for Node.js with Prisma and Mongoose adapters",
3
+ "version": "1.0.4",
4
+ "description": "Devise-inspired JWT authentication and authorization for Node.js and Express with adapter-based support for MongoDB (Mongoose) and Prisma",
5
5
  "author": "Yogendra Prajapati",
6
6
  "license": "MIT",
7
7
  "main": "dist/index.js",
@@ -17,29 +17,37 @@
17
17
  "prepublishOnly": "npm run build"
18
18
  },
19
19
  "keywords": [
20
+ "node-auth-kit",
21
+ "node auth",
22
+ "node authentication",
20
23
  "authentication",
21
24
  "authorization",
22
- "device-auth",
25
+ "jwt authentication",
23
26
  "jwt",
24
- "nodejs",
25
- "express",
26
- "prisma",
27
- "mongoose"
27
+ "express auth",
28
+ "express authentication",
29
+ "device authentication",
30
+ "devise",
31
+ "devise-like",
32
+ "security",
33
+ "mongoose auth",
34
+ "prisma auth"
28
35
  ],
29
36
  "repository": {
30
37
  "type": "git",
31
- "url": "git+https://github.com/learningyogendra-netizen/device_auth.git"
38
+ "url": "https://github.com/learningyogendra-netizen/device_auth.git"
32
39
  },
40
+ "homepage": "https://github.com/learningyogendra-netizen/device_auth#readme",
33
41
  "bugs": {
34
42
  "url": "https://github.com/learningyogendra-netizen/device_auth/issues"
35
43
  },
36
44
  "dependencies": {
37
45
  "bcrypt": "^6.0.0",
38
46
  "express": "^4.19.2",
39
- "jsonwebtoken": "^9.0.3",
40
- "mongoose": "^9.0.2"
47
+ "jsonwebtoken": "^9.0.3"
41
48
  },
42
49
  "peerDependencies": {
50
+ "mongoose": "^7 || ^8 || ^9",
43
51
  "@prisma/client": "^4.7.1 || ^5.0.0"
44
52
  },
45
53
  "devDependencies": {