streamich / fs-monkey

Monkey-patches for file system related things
The Unlicense
110 stars 19 forks source link

fix: add .rm and .rmSync to fs methods #362

Closed alienzhou closed 2 years ago

alienzhou commented 2 years ago

.rm and .rmSync were added in Node.js v14.14.0.

Although they has been implemented in memfs, they are not binded when calling createFsFromVolume().

// Bind FS methods.
for (const method of fsSyncMethods) if (typeof vol[method] === 'function') fs[method] = vol[method].bind(vol);
for (const method of fsAsyncMethods) if (typeof vol[method] === 'function') fs[method] = vol[method].bind(vol);

https://github.com/streamich/memfs/blob/dd3828afa053af441d37e92a8d449f6782554458/src/index.ts#L38-L40

These methods are not in fsSyncMethods and fsAsyncMethods now.

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.0.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: