Package Exports
- fs-no-eperm-anymore
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fs-no-eperm-anymore) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
fs-no-eperm-anymore
is a Node.js module that reduces EPERM or other errors on win32 or other platforms using retry loop approach.
Notes
- Original "fs" methods are wrapped into the ES2015 Promises.
- Module exposes only the
asyncfunctions. Retry approach is used and so it won't make much sense tosleepthe main process just to supportsyncmethods set. - Default
optionsvalue:
const options = {
items: [
{
platforms: ["win32"],
errorCodes: ["EPERM"], // https://nodejs.org/api/errors.html#errors_common_system_errors
options: {
retryIntervalMs: 100,
retryTimeoutMs: 10 * 1000,
},
},
],
};Code Example
import {instantiate} from "fs-no-eperm-anymore";
// const fs = require("fs-no-eperm-anymore").instantiate();
// options parameter is optional
const fs = instantiate(/*options*/);
fs.rename("from.txt", "to.txt")
.then(() => console.log("Successful renaming"))
.catch((error) => console.log("Renaming failed with the error", error)); You can see more details about the options parameter in the Making options more flexible issue.
Links
- https://github.com/isaacs/node-graceful-fs/pull/119 - more details about the EPERM errors.
- https://nodejs.org/api/errors.html#errors_common_system_errors - Common System Errors