@ndelangen/fs-extra-unified
This package allows you to import/require without deciding if you'll want ESM or CJS inside your import.
Last updated 2 years ago by ndelangen .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ndelangen/fs-extra-unified 
SYNC missed versions from official npm registry.

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

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.

Current Tags

  • 1.0.4--canary.5.5f6cfdd.0                                ...           canary (2 years ago)
  • 1.0.4                                ...           latest (2 years ago)

11 Versions

  • 1.0.4                                ...           2 years ago
  • 1.0.4--canary.5.5f6cfdd.0                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.3--canary.4.3ea4e68.0                                ...           2 years ago
  • 1.0.3--canary.3.b8f4470.0                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.2--canary.2.a251a74.0                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.1--canary.1.4781f8e.1                                ...           2 years ago
  • 1.0.1--canary.1.4781f8e.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 5
Last Month 0
Dependencies (0)
None
Dev Dependencies (5)

Copyright 2013 - present © cnpmjs.org | Home |