The fs module provides an file system API that works in deno, bun, and nodejs to promote creating cross-runtime packages/modules for TypeScript/JavaScript.
The API takes heavy influence from Deno's file system APIs because they are built on modern web standards and node was built when promises, iterator, and async iterator did not exist.
You can get documentation at https://jsr.io/@gnome/fs
import { makeDir, writeTextFile, remove } from "@gnome/fs" await makeDir("/home/my_user/test"); await writeTextFile("/home/my_user/test/log.txt", "ello"); await remove("/home/my_user/test", { recursive: true });
Most of the code from deno's std library which is under the MIT license except for the modifications required to enable testing and abstractions for deno and node.
Add Package
deno add jsr:@gnome/fs
Import symbol
import * as fs from "@gnome/fs";
---- OR ----
Import directly with a jsr specifier
import * as fs from "jsr:@gnome/fs";
Add Package
npx jsr add @gnome/fs
Import symbol
import * as fs from "@gnome/fs";
Add Package
yarn dlx jsr add @gnome/fs
Import symbol
import * as fs from "@gnome/fs";
Add Package
pnpm dlx jsr add @gnome/fs
Import symbol
import * as fs from "@gnome/fs";
Add Package
bunx jsr add @gnome/fs
Import symbol
import * as fs from "@gnome/fs";