Skip to content

πŸ“‚ @reliverse/relifso is a modern filesystem toolkit for builders. drop-in replacement for node:fs and fs-extra β€” powered by native promises, built with es modules, packed with dx-focused utilities.

License

Notifications You must be signed in to change notification settings

reliverse/relifso

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Relifso β€’ Node.js Filesystem Toolkit Library

sponsor β€” discord β€” npm β€” github

@reliverse/relifso is a modern filesystem toolkit for builders. drop-in replacement for node:fs and fs-extra β€” powered by native promises, built with es modules, and packed with dx-focused utilities.

Features

  • πŸͺ„ Everything you love from fs-extra β€” now simpler, cleaner, and more beginner-friendly
  • βš™οΈ Drop-in replacement for node:fs β€” with native Promise, async/await, and sync variants
  • 🀝 Forget about try-catch for common errors like β€œfile not found” β€” relifso does it under the hood
  • 🧯 Gracefully handles errors like EMFILE (reading or writing a lot of files at once) and other edge cases
  • πŸ“š Consistent error-first behavior β€” even for legacy APIs like fs.exists()
  • πŸ“¦ First-class ESM and full TypeScript support β€” no config hacks required
  • 🧼 Zero bloat β€” small size (4 kB), zero deps, modern code, no monkey-patching
  • 🎯 Supports all Node.js v16+ features β€” optimized for Node.js v22+
  • πŸ§ͺ Soon: Ready for upcoming Node.js v22+ experimental features
  • ✌️ Soon: Bun v1.2+ ready β€” ships with Bun-aware enhancements out of the box
  • πŸ”₯ Soon: Bun-specific features are exposed via fs.* when running on Bun

Heads Up

  • Most of the things mentioned in this doc aren’t implemented yet β€” they’re part of the vision for ~v1.3.0.
  • Got thoughts? Ideas? Send your feedback in Discord or use GitHub Issues.
  • Your feedback means the world and helps shape where this project goes next. Thank you!

Install

# bun β€’ pnpm β€’ yarn β€’ npm
bun add @reliverse/relifso

Migrate:

bun rm fs-extra
bun rm @types/fs-extra
# soon:
# bun add -D @reliverse/dler
# bun dler relifso node-fs to relifso
# bun dler relifso fs-extra to relifso

Coming soon:

bun add -D @reliverse/dler
bun dler relifso init ...

Usage

Check ./e-relifso.ts and ./e-pathkit.ts for a full examples. You can clone this repo and run via bun dev.

Relifso works just like fs-extra β€” every method is promise-first, ergonomic, and future-ready.

import { copy, pathExists, remove } from "@reliverse/relifso";

await copy("src/index.ts", "dist/index.ts");

if (await pathExists("dist/index.ts")) {
  await remove("dist/index.ts");
}
  • ✨ Everything’s bundled β€” modern, async, and type-safe.
  • 🧼 No more boilerplate like promisify(fs.removeSync) or using mkdirp, ncp, or rimraf.
  • 🌱 No more weird try/catch for common errors like β€œfile not found.”
  • ✌️ Just clean, predictable APIs built for 2025 and beyond.

Example

import {
  ensureDir,
  outputJson,
  readJson,
  remove,
} from "@reliverse/relifso";

const path = "./.reliverse/config.json";

await ensureDir(".reliverse");
await outputJson(path, { hello: "world" });

const config = await readJson(path);
console.log(config); // { hello: 'world' }

await remove(".reliverse");

Sync vs Async vs Legacy

You choose your flavor:

// Async/Await
await copy("a.txt", "b.txt");

// Sync
copySync("a.txt", "b.txt");

// Callback (legacy-style)
copy("a.txt", "b.txt", err => {
  if (err) console.error(err);
});

All async methods return a Promise if no callback is passed.

Fully Typed, Fully Modern

  • Written in modern ESM
  • Minimal dependencies
  • Full TypeScript declarations
  • Compatible with Node.js 16+, best with 22+
  • Async methods are built from the sync versions β€” no wrappers, no bloat

What’s Inside?

  • All async methods follow the Promise pattern by default.
  • All sync methods are safe and throw errors when needed.

Async (recommended)

Common Async Methods

Less Commonly Used Async Methods

Sync

Common Sync Methods

Less Commonly Used Sync Methods

Contributing

...

TODO

Shoutouts

Relifso wouldn’t be so cool without these gems:

Show Some Love

If @reliverse/relifso reduced the number of lines in your codebase:

License

MIT Β© 2025 Nazar Kornienko (blefnk)

About

πŸ“‚ @reliverse/relifso is a modern filesystem toolkit for builders. drop-in replacement for node:fs and fs-extra β€” powered by native promises, built with es modules, packed with dx-focused utilities.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published