Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
express-joi-simple
Advanced tools
npm i express-joi-simple --save
import * as express from 'express';
import * as joi from 'joi';
import * as BodyParser from 'body-parser';
import { Doc, Validate, RequestHandler } from 'express-joi-simple';
const app = express();
app.use(BodyParser.json());
const schema = {
body: {
test1: joi.string().required()
},
model: 'Register'
}
// Note middleware here
app.post('register', Validate(schema), (req: any, res: any) => {
res.json({
message: 'register'
})
})
app.use(RequestHandler);
app.listen(3000, () => {
// Note function Doc here
Doc(app);
})
Use require instead of import for plain Javascript. More complicated example you can find in example folder.
const settings = {
info: {
"version": "1.0.0",
"title": "Title Example",
"description": "Description API example",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "Example team"
},
"license": {
"name": "MIT"
}
},
host: 'localhost:3000',
basePath: '/',
documentaionPath: /doc
}
Doc(app, settings);
Default documentation path is: /
So you can find documentation: localhost:3000/
FAQs
## Installation
The npm package express-joi-simple receives a total of 0 weekly downloads. As such, express-joi-simple popularity was classified as not popular.
We found that express-joi-simple demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.