Slash Node Modules Loader
This module rewrites paths during require() so that if it sees a prefix of '/node_modules/' it is removed.
Example usage:
node -r slash-node-modules-loader ./index.js
// in index.js const path = ;const express = ;const request = ;
It also works with esm for ES Modules.
node -r esm -r slash-node-modules-loader ./index.js
// in index.js ;
The purpose of this is to allow ES Modules to be used isomorphicly by exposing '/node_modules/' as a route on the server. So any packages from npm can be used on the client and server without needing to use proxy modules.