fs-extra
but customizable by overriding modules using monkey patching.
customizable-fs-extra
has exactly the same API as fs-extra.
Just replace the fs
module with the custom fs
. The custom fs
module must have the same properties and methods as the fs
module.
One of the following modules can be replaced using proxyquire. The paths are relative to the proxyquire-fs-extra
root.
./lib/override/node-version
: Anobject
containing the following propertyvalue
: Astring
being the node file system api the custom file system api is equivalent to.
./lib/override/options
: Anobject
containting the following properties:useBigInt
: Aboolean
whether the custom file system supports big-ints. Normally, this value is derived by comparing the current node version.useNativeRecursiveOption
: Aboolean
whether the custom file system supports the recursive option. Normally, this value is derived by comparing the current node version.
const proxyquire = require('proxyquire')
const memfs = require('memfs')
const memfse = proxyquire("fs-extra", {
'fs': {
...memfs,
'@global': true
},
'./lib/override/node-version': {
value: '14.0.0',
'@global': true
}
});
TODO