{"name":"steno","version":"1.0.0","description":"Fast file writer with race condition prevention and atomic writing","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"test":"jest","build":"del-cli lib && tsc","prepare":"husky install","prepublishOnly":"npm run build","postversion":"git push && git push --tags && npm publish","benchmark":"ts-node src/benchmark.ts"},"repository":{"type":"git","url":"git+https://github.com/typicode/steno.git"},"keywords":["fs","file","write","writer","asynchronous","fast","race","condition","atomic","writing","safe"],"author":{"name":"Typicode","email":"typicode@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/typicode/steno/issues"},"homepage":"https://github.com/typicode/steno","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@commitlint/prompt-cli":"^12.0.1","@tsconfig/node10":"^1.0.7","@types/jest":"^26.0.20","@types/node":"^14.14.31","@typicode/eslint-config":"^0.1.0","del-cli":"^3.0.1","husky":"^5.1.3","jest":"^26.6.3","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.2"},"eslintConfig":{"extends":"@typicode","parserOptions":{"project":["./tsconfig.lint.json"]}},"gitHead":"7492ae7b3d8fa71dddbbb6b73324ed450aaca340","_id":"steno@1.0.0","_nodeVersion":"15.10.0","_npmVersion":"7.6.1","dist":{"integrity":"sha512-C/KgCvEa1yWnpHmaPjAXrz1yWxh6hs+HvhqqPa71euaQmNi1wr4+WFo57VQxjKKuFl2KqS7gtlrN0oxj2noQLw==","shasum":"475e32c6066ec9760229eaaf1550601764fbecba","tarball":"http://registry-npm.ywwl.com/steno/download/steno-1.0.0.tgz","fileCount":5,"unpackedSize":6041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSogtCRA9TVsSAnZWagAAf10P/jDqJlLre+rvFcFRcLmT\nWjj07i/QE+gQ78t9Pj0LgiV+7gs2UN1zfNbF88PjkJ9KUUwlsZ8NneKrjuF6\n8snQXkgz6+uf+egF7MdNiGnCplZHoINNmENaI7TiRE9DG82K8UsxX37zLWRE\n9J5bO9mTmjwvonVTlJwBF0FXCAqs8hsSkXgoJemk8Dgu2Ev7ie+NQ7EgJwHN\nla91y3U2yhK79/DjbzFw8rY2criwLsTwGKoBDeLJGcLY01gw0hPtcbyEyOJj\nElNUidotV85GGfH7+Y/A1z4hSGpk/V+zgOLmxeNhahP+MqLZuPCtgtY9Yy8x\ngBgtR87sp9VV/+KCF/YDrOofppEwhNGxTJkLGC1Xn8Nb4jr/0BReEY55qOPC\ns8gmMGzuIPgkf5epr9ZmR1EH2yIJpW7sg2BQpczhPvQwcqRGYpPKh2JbJwKW\nGdIim4ltmTZB+mqJZmrKd94vzz0DEo1oIPpACDPXj73ZHU0m/ZPA/wy0+qxU\npdgmk4yL8bOmsoW5sDjVIWBNztcKc9Udl4cjpCSUeNz1FDybt4ixwxQbrq1s\nF/IIGpFhM0L2TT8v20CxS9vIWB0BFDESVDS6li1uVnBh81qxGiT+EJGdJdsq\nI/ywc2dymD8eagaqjPNT4S5eNp2jTvS/3zoDK+N4pgwvY/FJRjont4s0YP56\n3MLn\r\n=iw4I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICF07AFxq5MMZOXpjlssP5Wcp4+/Dji07T9Jmcco/+YUAiABVl5Wo3RoMRogf4dlIZxhpvZreEPwF97qzPOH2GfQMQ=="}],"size":2707,"noattachment":false,"key":"/steno/-/steno-1.0.0.tgz"},"_npmUser":{"name":"typicode","email":"typicode@gmail.com"},"directories":{},"maintainers":[{"name":"typicode","email":"typicode@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/steno_1.0.0_1615497260867_0.264489432178721"},"_hasShrinkwrap":false,"readme":"# Steno [![](http://img.shields.io/npm/dm/steno.svg?style=flat)](https://www.npmjs.org/package/steno) [![Node.js CI](https://github.com/typicode/steno/actions/workflows/node.js.yml/badge.svg)](https://github.com/typicode/steno/actions/workflows/node.js.yml)\n\n> Specialized fast async file writer\n\n**Steno** makes writing to the same file often/concurrently fast and safe.\n\nUsed in [lowdb](https://github.com/typicode/lowdb).\n\n_https://en.wikipedia.org/wiki/Stenotype_\n\n## Features\n\n- ⚡ Fast (see benchmark)\n- 🐦 Lightweight (~6kb)\n- 👍 ⚛️ Safe: No partial writes (writes are atomic)\n- 👍 🏁 Safe: No race conditions (writes are ordered even if they're async)\n\n## Usage\n\n```javascript\nimport { Writer } from 'steno'\n\n// Create a singleton writer\nconst file = new Writer('file.txt')\n\n// Use it in the rest of your code\nasync function save() {\n  await file.write('some data')\n}\n```\n\n## Benchmark\n\n`npm run benchmark` (see `src/benchmark.ts`)\n\n```\nWrite 1KB data to the same file x 1000\n  fs     :   62ms\n  steno  :    1ms\n\nWrite 1MB data to the same file x 1000\n  fs     : 2300ms\n  steno  :    5ms\n```\n\n_Steno uses a smart queue and avoids unnecessary writes._\n\n## License\n\nMIT - [Typicode](https://github.com/typicode)\n","publish_time":1615497260969,"_cnpm_publish_time":1615497260969,"dist-tags":{"latest":"4.0.2"}}