Skip to main content

Built and signed on GitHub Actions

File sink and rotating file sink for LogTape

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
4 weeks ago (0.9.0)
function getFileSink
getFileSink(
path: string,
options?: FileSinkOptions,
): Sink & Disposable

Get a file sink.

Note that this function is unavailable in the browser.

Parameters

path: string

A path to the file to write to.

optional
options: FileSinkOptions

The options for the sink.

Return Type

Sink & Disposable

A sink that writes to the file. The sink is also a disposable object that closes the file when disposed.

Add Package

deno add jsr:@logtape/file

Import symbol

import { getFileSink } from "@logtape/file";

---- OR ----

Import directly with a jsr specifier

import { getFileSink } from "jsr:@logtape/file";

Add Package

npx jsr add @logtape/file

Import symbol

import { getFileSink } from "@logtape/file";

Add Package

yarn dlx jsr add @logtape/file

Import symbol

import { getFileSink } from "@logtape/file";

Add Package

pnpm dlx jsr add @logtape/file

Import symbol

import { getFileSink } from "@logtape/file";

Add Package

bunx jsr add @logtape/file

Import symbol

import { getFileSink } from "@logtape/file";