active-cache-babel-register

alternative babel-register improves performance and supports multi-process

Usage no npm install needed!

<script type="module">
  import activeCacheBabelRegister from 'https://cdn.skypack.dev/active-cache-babel-register';
</script>

README

active-cache-babel-register

npm version Build Status Coverage Status

active-cache-babel-register improves performance of babel transpilation using cache actively.

Cache Strategy

  • babel finds config files and load these files every startup time, active-cache-babel-register set the config files to cache registry.
  • babel-register does not support multi-process cache like cluster/child_process, active-cache-babel-register has 2 cache stores, 1st cache store is original one, 2nd cache store can be used in multi-process
  • active-cache-babel-register purges cache if babel-version/.babelrc/package.json/.babelignore and target files are changed

Performance

babel-register
Total duration time: 18170ms

active-cache-babel-register
Total duration time: 5122ms

Usage

usage is almost same to babel-register.

$ npm install actice-cache-babel-register
$ node --require active-cache-babel-register foo.js