// the find
typicode/steno
Super fast async file writer with atomic write ⚡
Steno is a small Node library that wraps a single file and serialises writes to it, so many async callers can call write() without corrupting the file. It was extracted from lowdb and suits JSON-on-disk stores or any code path where several async writers hit the same file.
- Writes are queued and coalesced: while one write is in flight, later calls wait, and only the most recent payload is written next. That is where the benchmark gap comes from, since a burst of 1000 writes becomes a handful of disk writes.
- Atomic writes go to a temp file that is then renamed over the target, so a crash or power cut mid-write leaves the previous version intact instead of a half-written file.
- The public surface is one class and one write() method, so there is little to misuse and the source in src/index.ts can be read in a few minutes.
- It has real production exposure through lowdb, which is a better signal than a benchmark alone.
- The queue lives in process memory. Two processes writing the same path do not coordinate, and the last rename wins. If you need cross-process safety, you need a lock file or a different tool.
- The atomicity guarantee depends on rename being atomic on the target filesystem. The temp file sits next to the target, so the directory must be writable, and on network filesystems the guarantee is weaker than the README suggests.
- The benchmark is a single run with no hardware, Node version, or variance reported, and it compares against a naive fs.writeFile loop. That is not a fair baseline for anyone who would batch their own writes.
- The last push was June 2024, over two years ago. For a library that sits under a data path, check the open issues before adopting it.