Socket
Socket
Sign inDemoInstall

@ndelangen/fs-extra-unified

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ndelangen/fs-extra-unified

This package allows you to import/require without deciding if you'll want ESM or CJS inside your import.


Version published
Maintainers
0
Created
Source

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.

Keywords

FAQs

Package last updated on 03 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc