node-function-library
v1.1.0
Published
This package provides utility functions for Node.js applications. It includes various reusable functions like pagination handling and a search feature to look up functions by name or description.
Downloads
278
Readme
Node Function Library
This package provides utility functions for Node.js applications. It includes various reusable functions like pagination handling and a search feature to look up functions by name or description.
Functions
1. searchFunction(searchTerm)
The searchFunction
allows users to search for available functions in this package by their name or description. This helps in finding relevant functions easily without manually browsing the code.
Parameters:
searchTerm
(string): The term to search for in the function names or descriptions.
Returns: An array of matching functions from
node-function-library
that contain the search term in their name or description.Usage Example:
const { searchFunction } = require('node-function-library'); const results = searchFunction('pagination'); console.log(results); // Output: Array of functions with 'pagination' in their name or description
createPaginationInfo(page, limit)
Creates pagination information for API responses.
- page: The current page number (default is 1)
- limit: The number of items per page (default is 20)
Returns: An object containing:
page
: The current page numberlimit
: The number of items per pageskip
: The number of items to skip for pagination