
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
api-endpoint
Advanced tools
EndPoint is a schema-validated waterfall.
var EndPoint = require('api-endpoint'),
Joi = EndPoint.Joi;
var myEndpoint = EndPoint.create({
headers: Joi.object(), // Headers validator
payload: Joi.object(), // Payload validator
query: Joi.object(), // Query string validator
params: Joi.object(), // URL string validator
response: Joi.object(), // Response validator
validateOptions: { // optional JOI validation options
abortEarly: false,
stripUnknown: true
},
filters: [ // An array of work to perform
function findUser(data, next) {
next(err || null, data);
},
function createTask(data, next) {
next(err || null, data);
}
]
});
module.exports = endpoint;
myEndpoint.run(data, function(err, data) {
console.log(err, data); // `data` is the final object scoped to the outgoing schema
})
Your endpoint is a waterfall. If any of your filters
error, your endpoint will run its callback function with the error you provide (data
will be null
).
FAQs
EndPoint is a schema-validated waterfall.
We found that api-endpoint 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
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.