api-paginate 1.0.2 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +10 -0
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -4,6 +4,16 @@ Paginate arrays in **Node** (and browsers). In-memory pagination for arrays. Use
4
4
 
5
5
  Returns JSON with `data`, `meta`, and `links`—ready to send. Configure once, pass only `route`.
6
6
 
7
+ ### Why api-paginate?
8
+
9
+ - **One place to configure** — Set `baseUrl` in your entry file; in every route you only pass `route` and `per_page`. No repeating yourself.
10
+ - **Any array, any stack** — Mongoose, Prisma, Sequelize, raw SQL, or a plain `[]`. Pagination happens in memory after you fetch; no ORM magic or query hooks.
11
+ - **Familiar JSON shape** — `data`, `meta`, and `links` (first/prev/next/last) match what many APIs and frontends expect. No custom envelope.
12
+ - **Small and predictable** — No database layer, no heavy deps. Just slicing arrays and building links. Easy to reason about and safe to upgrade.
13
+ - **Works in Node and browsers** — Use it in API routes or in the client; in the browser it uses `window.location.origin` when you don’t call `configure`.
14
+
15
+ If you’ve ever copy-pasted pagination logic or built `meta`/`links` by hand, this package replaces that with a single call in your return.
16
+
7
17
  ### Features
8
18
 
9
19
  - **Framework-agnostic** — Use with Express, Next.js, Fastify, or plain Node
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "api-paginate",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Paginate arrays for Node and browsers. Configure once at app entry (app.ts/server.ts); use paginate/paginateFromRequest in routes. Returns JSON with data, meta, and links.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -21,6 +21,7 @@
21
21
  "url": "git+https://github.com/Michael-Builds/api-paginate.git"
22
22
  },
23
23
  "homepage": "https://api-paginate.vercel.app",
24
+ "docs": "https://api-paginate.vercel.app/docs",
24
25
  "bugs": {
25
26
  "url": "https://github.com/Michael-Builds/api-paginate/issues"
26
27
  },