Isomorphic, fs-agnostic implementation of the Node commonjs module system.
npm install @file-services/commonjs

Isomorphic, fs-agnostic implementation of Node's CommonJS module system.
Install library in project:
``sh`
npm i @file-services/commonjs
Then, use the programmatic API:
`ts
import { createCjsModuleSystem } from "@file-services/commonjs";
import { createMemoryFs } from "@file-services/memory";
const fs = createMemoryFs({
"some-folder": {
"index.js": module.exports = 'exported value',
},
});
const moduleSystem = createCjsModuleSystem({ fs });
const evaluated = moduleSystem.requireModule("/some-folder/index.js");
// evaluated === 'exported value'
``
MIT