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.
Generate markdown documentation files from [@hapi/joi](https://github.com/hapijs/joi) schemas.
Generate markdown documentation files from @hapi/joi schemas.
npm i --save-dev joi-md-doc
const joi = require('@hapi/joi');
const { makeMarkdownDoc } = require('joi-md-doc');
const schema = joi
.object()
.keys({
version: joi
.number()
.meta({ default: '1.0.0' })
.description('Follows semantic versioning.'),
any: joi.any(),
primitiveList: joi
.array()
.items(joi.string(), joi.number(), joi.boolean())
.min(1)
.max(3),
})
.meta({ name: 'My Schema', filename: 'mySchema' });
makeMarkdownDoc(schema);
JoiSchema → undefined
Traverses a root joi object schema and generates a markdown documentation file of every nested object schema in the tree.
JoiSchema → {String: String}
string
| required
The filename of each generated markdown file. Required for each joi object schema.
const schema = joi.object().keys({
foo: joi.string(),
}).meta({ filename: 'exampleSchema' });
string
| optional | defaults to value offilename
The name/title of the markdown file.
const schema = joi.object().keys({
foo: joi.string(),
}).meta({ name: 'Example Schema', filename: 'exampleSchema' });
*
| optional
The default value.
const schema = joi.object().keys({
version: joi.number().meta({ default: '1.0.0' }),
}).meta({ filename: 'exampleSchema '});
boolean
| optional | defaults totrue
Flag that determines whether or not a key is documented.
const schema = joi.object().keys({
includedInDoc: joi.boolean(),
excludedFromDoc: joi.boolean().meta({ isDocumented: false }),
}).meta({ filename: 'exampleSchema' });
Check out the example joi schema and generated markdown for currently supported joi validations.
FAQs
Generate markdown documentation files from [@hapi/joi](https://github.com/hapijs/joi) schemas.
We found that joi-md-doc 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.