Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ndelangen/fs-extra
proper esm support version of fs-extra, with exports map and type definitions
https://github.com/ndelangen/fs-extra
Last synced: 20 days ago
JSON representation
proper esm support version of fs-extra, with exports map and type definitions
- Host: GitHub
- URL: https://github.com/ndelangen/fs-extra
- Owner: ndelangen
- Created: 2024-01-18T13:14:14.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-08-03T20:14:23.000Z (3 months ago)
- Last Synced: 2024-10-07T17:06:13.854Z (about 1 month ago)
- Language: JavaScript
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# fs-extra but fully ESM/CJS compatible. 1.0.0
This package allows you to import/require without deciding if you'll want ESM or CJS inside your import.
This package uses exportsMaps in `package.json` to achieve the affect where if you:
- `import` this package, you'll get the ESM version of `fs-extra` (`fs-extra/esm`)
- `require` this package, you'll get the CJS version of `fs-extra`This is useful if you're bundling/running your code for multiple environments.
## Usage
```js
import * as fse from "@ndelangen/fs-extra-unified";
```This package will yield the correct type definitions, but only implements/exports the implementations and types from `fs-extra/esm`.
So you'll want to use `node:fs/promises` for things such as `readFile` and `writeFile`.I wrote this because I needed it in storybook, and https://www.npmjs.com/package/fs-extra-unified re-implemented the entire fs-extra API, causing it to lag behind and risk security patches to not be applied.
As this package has `fs-extra` is a peerDependency, it does not implement any functionality itself.