How to use the @babel/register/lib/cache.load function in @babel/register

To help you get started, we’ve selected a few @babel/register examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github awto / effectfuljs / packages / debugger / config / node / register.js View on Github external
const savedConsole = console;

const builtIn = Module.builtinModules.filter(i => {
  switch (i) {
    case "sys":
      return false;
  }
  if (/^(?:v8|node-inspect)\//g.test(i)) return false;
  return true;
});

let cache;

if (config.cache) {
  registerCache.load();
  cache = registerCache.get();
}

let babelOpts = config.babelOpts || {};

babelOpts = {
  ...babelOpts,
  caller: {
    name: "@effectful/debugger",
    ...(babelOpts.caller || {})
  }
};

const log = (...args) => console.log(...args);

function mtime(filename) {

@babel/register

babel require hook

MIT
Latest version published 17 days ago

Package Health Score

95 / 100
Full package analysis