Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 448 Bytes

README.md

File metadata and controls

16 lines (11 loc) · 448 Bytes

Example APM Loader

This loader overloads the fs module specifier to point to a new version with a different readFile implementation as an example for how to create tooling like APMs or mocking in ESM using loader hooks.

This loader can be used by passing in the --loader flag to node.

node --experimental-modules --loader ./index.mjs $MAIN

or

NODE_OPTIONS='--experimental-modules --loader ./index.mjs'
node $MAIN