Assorted file I/O utils (w/ logging support) for NodeJS/Bun
npm install @thi.ng/file-io
!npm downloads

> [!NOTE]
> This is one of 214 standalone projects, maintained as part
> of the @thi.ng/umbrella monorepo
> and anti-framework.
>
> 🚀 Please help me to work full-time on these projects by sponsoring me on
> GitHub. Thank you! ❤️
- About
- Available functions
- Files
- Directories
- Logging
- Status
- Installation
- Dependencies
- Usage examples
- API
- Authors
- License
Assorted file I/O utils (w/ logging support) for NodeJS/Bun.
Most functions in this package have optional support for theILogger
logging interface.
- bufferHash
- copyFile
- copyFileAsync
- createTempFile
- deleteFile
- deleteFileAsync
- deleteFiles
- deleteFilesAsync
- files
- fileChunks
- fileExt
- fileHash
- fileWatcher
- readBinary
- readBinaryAsync
- readJSON
- readJSONAsync
- readText
- readTextAsync
- streamHash
- tempFilePath
- writeFile
- writeFileAsync
- writeJSON
- writeJSONAsync
- writeText
- writeTextAsync
- deleteDir
- dirs
- ensureDir
- ensureDirForFile
- isDirectory
- maskedPath
- addPathMask
- setPathMasks
STABLE - used in production
Search or submit any issues for this package
``bash`
yarn add @thi.ng/file-io
ESM import:
`ts`
import * as fio from "@thi.ng/file-io";
For Node.js REPL:
`js`
const fio = await import("@thi.ng/file-io");
Package sizes (brotli'd, pre-treeshake): ESM: 2.44 KB
- @thi.ng/api
- @thi.ng/checks
- @thi.ng/hex
- @thi.ng/logger
- @thi.ng/random
Note: @thi.ng/api is in _most_ cases a type-only import (not used at runtime)
One project in this repo's
/examples
directory is using this package:
| Screenshot | Description | Live demo | Source |
|:---------------------------------------------------------------------------------------------------------------------|:-----------------------------------------|:----------|:---------------------------------------------------------------------------------|
|
| CLI util to visualize umbrella pkg stats | | Source |
TODO
If this project contributes to an academic publication, please cite it as:
`bibtex``
@misc{thing-file-io,
title = "@thi.ng/file-io",
author = "Karsten Schmidt",
note = "https://thi.ng/file-io",
year = 2022
}
© 2022 - 2026 Karsten Schmidt // Apache License 2.0