Snippetz

A modern way to generate HTTP request examples for different languages and libraries.
Check out some examples here
Installation
npm install @scalar/snippetz
Usage
import { snippetz } from '@scalar/snippetz'
const snippet = snippetz().print('node', 'undici', {
url: 'https://example.com',
})
API
Get all plugins
import { snippetz } from '@scalar/snippetz'
const snippet = snippetz().plugins()
Check if a plugin is loaded
import { snippetz } from '@scalar/snippetz'
const snippet = snippetz().hasPlugin('node', 'undici')
Lean usage
You can also just use one specific plugin to keep your bundle size small.
import { nodeUndici } from '@scalar/snippetz/plugins/node/undici'
const result = nodeUndici.generate({
url: 'https://example.com',
})
console.log(source)
We are API nerds. You too? Let’s chat on Discord: https://discord.gg/scalar
License
The source code in this repository is licensed under MIT.