Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@caruuto/api-metadata
Advanced tools
Generates pagination metadata for API result sets.
{
"page": 2,
"limit": 20,
"offset": 0,
"totalCount": 200,
"totalPages": 10,
"nextPage": 3,
"prevPage": 1
}
$ npm i api-metadata
The metadata function accepts two arguments:
argument | description |
---|---|
options | the options that were used to generate the data set |
options.page | the page number requested |
options.limit | the number of records requested |
options.skip | the number of records skipped |
count | the total number of records in the original data set, before options were applied |
const apiMetadata = require('api-metadata')
const options = {
page: 2,
limit: 20
}
const metadata = apiMetadata(options, 200)
FAQs
Generates pagination metadata for API result sets
We found that @caruuto/api-metadata demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.