UNPKG

nuxt

Version:

Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.

18 lines (17 loc) 566 B
//#region src/app/internal/tracing.ts let _channels; function getChannel(name) { _channels ??= {}; if (name in _channels) return _channels[name]; const dc = globalThis.process?.getBuiltinModule?.("node:diagnostics_channel"); const channel = dc?.tracingChannel ? dc.tracingChannel(name) : null; _channels[name] = channel; return channel; } function traceAsync(name, context, fn) { const channel = getChannel(name); if (!channel || channel.hasSubscribers === false) return fn(); return channel.tracePromise(fn, context); } //#endregion export { traceAsync };