Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@supertenant/collector / esm-loader.mjs
Size: Mime:
// (c) Copyright 2023 Supertenant Ltd. - all rights reserved.
// See LICENSE file in project root for license terms.

/**
 * We currently only instrument CJS modules. As soon as we want
 * to instrument ES modules (such as `got` v12), the requireHook will
 * no longer work. Therefor we would need to wrap the target ES module
 * with our instrumentations using the resolve & load hook.
 *
 * Usage:
 * node --experimental-loader=@supertenant/collector/esm-loader.mjs server.js
 *
 * NOTE: When using ESM the customer can only configure the collector with
 *       ENV variables.
 */

// eslint-disable-next-line import/extensions
import init from './src/index.js';
init();

/*
export async function resolve(specifier, context, nextResolve) {
  return nextResolve(specifier, context, nextResolve);
}

export async function load(url, context, nextLoad) {
  return nextLoad(url, context, nextLoad);
}
*/