@popov/file-writer@1.2.0
latest
PopovMP/deno-file-writerWorks with
•JSR Score100%•This package works with Node.js, Deno

Downloads1/wk
•Publisheda year ago (1.2.0)
File Writer supports multiple asynchronous write operations while preventing racing conditions.
This module exports two functions: appendText and writeText.
The purpose of this functions is to work asynchronously without the need of waiting for the result.
If multiple write requests appear without the previous write job has been finished, the functions cache the data and reschedule the operation.
import { appendText } from "@popov/file-writer"; appendText("log.txt", "foo\n"); appendText("log.txt", "bar\n"); // `log.txt` contains: // foo // bar
import { writeText } from "@popov/file-writer"; writeText("log.txt", "foo\n"); writeText("log.txt", "bar\n"); // `log.txt` contains: // bar
This module works in Deno and NodeJS.
Add Package
deno add jsr:@popov/file-writer
Import symbol
import * as file_writer from "@popov/file-writer";
Import directly with a jsr specifier
import * as file_writer from "jsr:@popov/file-writer";
Add Package
pnpm i jsr:@popov/file-writer
pnpm dlx jsr add @popov/file-writer
Import symbol
import * as file_writer from "@popov/file-writer";
Add Package
yarn add jsr:@popov/file-writer
yarn dlx jsr add @popov/file-writer
Import symbol
import * as file_writer from "@popov/file-writer";
Add Package
vlt install jsr:@popov/file-writer
Import symbol
import * as file_writer from "@popov/file-writer";
Add Package
npx jsr add @popov/file-writer
Import symbol
import * as file_writer from "@popov/file-writer";