sponsor β discord β npm β github
@reliverse/relifso is a modern filesystem toolkit for builders. drop-in replacement for
node:fs
andfs-extra
β powered by native promises, built with es modules, and packed with dx-focused utilities.
- πͺ Everything you love from
fs-extra
β now simpler, cleaner, and more beginner-friendly - βοΈ Drop-in replacement for
node:fs
β with nativePromise
,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
- 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!
# 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 ...
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 usingmkdirp
,ncp
, orrimraf
. - π± No more weird
try/catch
for common errors like βfile not found.β - βοΈ Just clean, predictable APIs built for 2025 and beyond.
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");
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.
- 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
- All async methods follow the
Promise
pattern by default. - All sync methods are safe and throw errors when needed.
- access
- appendFile
- copy
- copyFile
- cp
- createReadStream
- createWriteStream
- ensureFile
- exists
- mkdir
- mkdirs
- move
- open
- outputFile
- outputJson
- read
- readdir
- readFile
- readJson
- readLines
- readText
- rename
- rm
- rmdir
- stat
- symlink
- truncate
- unlink
- watch
- watchFile
- write
- writeFile
- writeJson
- chmod
- chown
- close
- dive
- emptyDir
- ensureLink
- ensureSymlink
- fchmod
- fchown
- forEachChild
- fstat
- ftruncate
- futimes
- gracefulify
- isDirectory
- isSymlink
lchmod- lchown
- link
- lstat
- lutimes
- mapChildren
- mapStructure
- mapStructureOrdered
- mkdtemp
- openAsBlob
- opendir
- readv
- realpath
- remove
- resolve
- statfs
- unwatchFile
- utimes
- vacuum
- writev
- accessSync
- appendFileSync
- copyFileSync
- copySync
- cpSync
- existsSync
- mkdirSync
- mkdirsSync
- moveSync
- openSync
- outputFileSync
- outputJsonSync
- readdirSync
- readFileSync
- readJsonSync
- readTextSync
- renameSync
- rmSync
- rmdirSync
- statSync
- symlinkSync
- truncateSync
- unlinkSync
- writeFileSync
- writeJsonSync
- writeSync
- chmodSync
- chownSync
- closeSync
- diveSync
- emptyDirSync
- ensureFileSync
- ensureLinkSync
- ensureSymlinkSync
- fchmodSync
- fchownSync
- fdatasync
- fdatasyncSync
- forEachChildSync
- fstatSync
- fsync
- fsyncSync
- ftruncateSync
- futimesSync
- isDirectorySync
lchmodSync- lchownSync
- linkSync
- lstatSync
- lutimesSync
- mkdirsSync
- mkdtempSync
- opendirSync
- readLinesSync
- readlinkSync
- readSync
- readvSync
- realpathSync
- removeSync
- statfsSync
- utimesSync
- writevSync
...
- Create usage example in ./e-relifso.ts and ./e-pathkit.ts
- Ensure ./e-relifso.ts and ./e-pathkit.ts works 100% correctly
- Consider using @reliverse/repath instead of just
node:path
. - Pass all
fs-extra
tests with Bun (+ fix & improve them). - Convert all jsdoc comments to TypeScript types.
- Fully improve all
fs-extra
codebase files.
Relifso wouldnβt be so cool without these gems:
If @reliverse/relifso
reduced the number of lines in your codebase:
- β Star it on GitHub
- π Sponsor @blefnk
- π§ Recommend it to your dev friends
MIT Β© 2025 Nazar Kornienko (blefnk)