Skip to main content
Home
Works with
This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
JSR Score94%
Downloads2/wk
Published2 years ago (0.1.0)

Reimplementation of sponge from moreutils, for Deno.

sponge

Reimplementation of sponge(1) from moreutils, for Deno.

JSR CI

Requirements

Requires Deno v1.44.1 or later.

Usage

Soak up stdin, write to stdout

deno run jsr:@moreutils/sponge

Soak up stdin, write to a file

deno run --allow-write=file.txt jsr:@moreutils/sponge file.txt

Soak up stdin, append to a file

deno run --allow-write=file.txt jsr:@moreutils/sponge -a file.txt

Example usage

Given a file file.txt with the following contents:

The quick brown fox jumps over the lazy dog.

The foo bar baz.

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Running this command, will replace its contents with the same, piped through sed:

cat file.txt |
sed -e 's/foo/bar/' |
deno run --allow-write=file.txt jsr:@moreutils/sponge file.txt

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@moreutils/sponge

Import symbol

import * as sponge from "@moreutils/sponge";
or

Import directly with a jsr specifier

import * as sponge from "jsr:@moreutils/sponge";

Add Package

pnpm i jsr:@moreutils/sponge
or (using pnpm 10.8 or older)
pnpm dlx jsr add @moreutils/sponge

Import symbol

import * as sponge from "@moreutils/sponge";

Add Package

yarn add jsr:@moreutils/sponge
or (using Yarn 4.8 or older)
yarn dlx jsr add @moreutils/sponge

Import symbol

import * as sponge from "@moreutils/sponge";

Add Package

vlt install jsr:@moreutils/sponge

Import symbol

import * as sponge from "@moreutils/sponge";

Add Package

npx jsr add @moreutils/sponge

Import symbol

import * as sponge from "@moreutils/sponge";

Add Package

bunx jsr add @moreutils/sponge

Import symbol

import * as sponge from "@moreutils/sponge";