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')
}
基准
npm run benchmark (见 src/benchmark.ts(中文(简体) )
Write 1KB data to the same file x 1000
fs : 62.303ms
steno : 1.384ms
fs.txt = steno.txt ✓
Write 1MB data to the same file x 1000
fs : 2.300s
steno : 5.444ms
fs.txt = steno.txt ✓