@fastify/error
Version:
A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.
10 lines (7 loc) • 319 B
JavaScript
const benchmark = require('benchmark')
const createError = require('..')
new benchmark.Suite()
.add('create FastifyError', function () { createError('CODE', 'Not available') }, { minSamples: 100 })
.on('cycle', function onCycle (event) { console.log(String(event.target)) })
.run({ async: false })