
Security News
Inside Lodash’s Security Reset and Maintenance Reboot
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.
@single9/api-wrapper
Advanced tools
Call your APIs like a function.
npm i @single9/api-wrapper
const ApiWrapper = require('@single9/api-wrapper');
const api = new ApiWrapper([
{
name: '<Api Name>', // only allow certain words and digits
path: '<Api Path>', // e.g. /api/posts
method: '<HTTP Method>', // e.g. post
},
], {
baseUrl: '<Base URL of API>' // e.g. https://jsonplaceholder.typicode.com
// Default: http://localhost:3000
headers: {
// The headers you want to send. e.g. 'authorization': 'Bearer SAdoweasd...',
},
auth: { // authorization
username: 'username',
password: 'password',
}
})
api.<api_name>(params)
ApiWrapper instance.Used for query string. e.g. /users?limit=100
api.test({
queryString: {
key: value
}
})
api.test({
queryString: [
{
name: string,
value: string | number,
}
]
})
Used for path parameters. e.g. /user/:id
api.test({
pathParams: {
key: value
}
})
api.test({
pathParams: [
{
name: string,
value: string | number,
}
]
})
const ApiWrapper = require('@single9/api-wrapper');
// Create your API schema
const schema = [
{
name: 'newPost', // this is your api function name
path: '/posts',
method: 'post',
},
{
name: 'getTodo',
path: '/todos/:todoId', // path parameter
method: 'get',
},
];
const api = new ApiWrapper(schema, {
baseUrl: 'https://jsonplaceholder.typicode.com',
});
async function start() {
try {
const post = await api.newPost({
// Post Body
data: {
title: 'foo!!!!!!',
body: 'bar!!',
userId: 1
},
});
console.log(post.data);
const get = await api.getTodo({
pathParams: {
todoId: 2, // replace `:todoId` with value 2.
},
});
console.log(get.data);
} catch (err) {
console.error(err);
}
}
start();
FAQs
Define and Call your restful APIs like a function.
We found that @single9/api-wrapper demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.

Security News
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.

Security News
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.