Danh mục

typicode/steno

Super fast async file writer with atomic write ⚡

snapshot · 26/10/2026
TS

typicode/steno

JavaScript · danh tính provisional_slug_only

Super fast async file writer with atomic write ⚡

safeatomicfilewriterfsrace-condition-prevention
Sao—lịch sử sao
Hạng—snapshot toàn cục
Fork42bản ghi nguồn
Số ngày trending1lịch sử xu hướng
Snapshot chỉ có lịch sử sao đầy đủ của star-history/star-history. Lịch sử thiếu thì không vẽ.

README

Từ GitHub · lưu tạm tối đa 7 ngày

Steno Node.js CI

Super fast async file writer with atomic write

Steno makes writing concurrently fast and safe.

Battle-tested in lowdb.

Features

  • ⚡ Fast (see benchmark)
  • 🐦 Lightweight (~6kb)
  • 🩵 Written in TypeScript
  • 🖊️ Writes are atomic (no partial writes)
  • 🏎️ Writes are ordered even if they're async (no race conditions)
  • ♻️ Automatic retry

Usage

import { Writer } from 'steno'

// Create a singleton writer
const file = new Writer('file.txt')

// Use it in the rest of your code
async function save() {
  await file.write('some data')
}

Benchmark

npm run benchmark (see src/benchmark.ts)

Write 1KB data to the same file x 1000
  fs     :   62ms
  steno  :    1ms

Write 1MB data to the same file x 1000
  fs     : 2300ms
  steno  :    5ms

Steno uses a smart queue and avoids unnecessary writes.

Name

https://en.wikipedia.org/wiki/Stenotype

License

MIT - Typicode