Registry / testing / drf-paginator

drf-paginator

JSON →
library0.3.0jsnpmunverified

JavaScript module for consuming paginated Django REST Framework endpoints. Current stable version 0.3.0, released around 2016, with low release cadence. Key differentiator: separates pagination logic from individual requests, caches pages, and works with any Promises/A+ compliant implementation. Requires global Promise polyfill in older environments. Provides methods like next(), prev(), first(), last(), and reset(). Unmaintained since 2016.

npm install drf-paginator
INSTALL
IMPORT
SIG · DRF-PAGINATOR
D
drf-paginator
testingjavascriptv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

paginate
✓ import { paginate } from 'drf-paginator'
✗ import drfPaginator from 'drf-paginator'
Named export only; default import is not available.
default import (incorrect)
✓ import { paginate } from 'drf-paginator'
✗ const drfPaginator = require('drf-paginator'); drfPaginator.paginate(...)
CommonJS usage works but requires .paginate access. Prefer named import.
paginator methods
✓ const p = paginate(fetch); p.next().then(console.log)
✗ paginate.fetch(...)
paginate() returns a paginator object; methods are on that object.

Creates a paginator using fetch, gets the first page via next().

import { paginate } from 'drf-paginator'; const request = (options, params) => { const url = new URL('https://api.example.com/items'); if (params.page) url.searchParams.set('page', params.page); return fetch(url, options).then(r => r.json()); }; const p = paginate(request); p.next().then(data => { console.log('Page:', data); }).catch(err => { console.error('Error:', err); });
Debug
Known issues
deprecatedPackage is unmaintained since 2016. No updates for security or compatibility.
fix
Consider alternatives like react-query or swr for pagination, or use fetch/axios directly with manual pagination.
affects: >=0.0.0
gotchaRequires global Promise/A+ implementation. In browsers without native Promise, you must polyfill.
fix
Include a polyfill like 'es6-promise' before loading drf-paginator.
affects: >=0.0.0
gotchaUses ES2015 modules and requires Babelify transform for Browserify. Not compatible with modern bundlers like Webpack without configuration.
fix
For Webpack, ensure .babelrc has es2015 preset. For modern bundlers, use a transpiled version or fork.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: drfPaginator is not a function
Default import used, but package exports named function 'paginate'.
fix
import { paginate } from 'drf-paginator';
ReferenceError: Promise is not defined
No global Promise implementation (e.g., old Node.js or browser).
fix
Install and import a polyfill like 'es6-promise/auto' before drf-paginator.
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
drf-paginator — npm install drf-paginator · libregistry