Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
docunit
Advanced tools
Readme
There's nothing worse than a documented use of a library that doesn't actually work the way the docs say it does. But because docs tend to be written at discrete moments of a project's life, they're only validated at those particular moments—inevitably, the behavior of the API will diverge and someone will need to carry the burden of remembering to updathe docs.
Well, not anymore! docunit
is a tool that checks the code blocks in your Markdown
files to ensure they actually do what they say they do.
$ npm install --save-dev docunit
var docunit = require('docunit')
docunit('test/fixtures/1-hello-world.md', function(er, results){
results.passed // true
results.assertions.length // 1
results.files // ['test/fixtures/1-hello-world.md']
var assertion = results.assertions[0]
assertion.lineNumber // 8
assertion.actual // "greeting + ', world'"
assertion.expected // "'hello, world'"
assertion.result.passed // true
assertion.result.actual // 'hello, world'
assertion.result.expected // 'hello, world'
})
Warning: does not exist
$ docunit "path/to/docs/**/*.md"
FAQs
Makes sure the code examples in your docs actually work
The npm package docunit receives a total of 2 weekly downloads. As such, docunit popularity was classified as not popular.
We found that docunit 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.