# firescript-firefs

> File System lib for Firescript

Latest version **0.4.0** (published 2026-06-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install firescript-firefs
pnpm add firescript-firefs
yarn add firescript-firefs
bun add firescript-firefs
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2026-06-02 |
| First published | 2020-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 45.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andi Heinkelein |
| Maintainers | firetux |
| Keywords | firescript, fire, firelib, fs, file, filesystem |

## Links

- npm: https://www.npmjs.com/package/firescript-firefs
- npm.io page: https://npm.io/package/firescript-firefs

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.4.0 (latest) — 2026-06-02
- 0.3.3 — 2023-10-05
- 0.3.1 — 2022-06-21
- 0.2.2 — 2021-10-12
- 0.3.0 — 2021-01-29
- 0.2.1 — 2021-01-25
- 0.2.0 — 2021-01-15
- 0.1.8 — 2021-01-14
- 0.1.7 — 2020-12-15
- 0.1.6 — 2020-12-08
- 0.1.5 — 2020-12-08
- 0.1.4 — 2020-12-08
- 0.1.3 — 2020-12-04
- 0.1.2 — 2020-12-04
- 0.1.1 — 2020-10-19
- … 1 more at https://npm.io/package/firescript-firefs/versions

## README

FireFS
======

File System lib for Firescript

Usage
-----

#### Check file or dir exists

```js
import FireFS from 'firescript-firefs'

const fs = await FireFS.path('/foo/bar/blub')

if (fs.exists) {
  console.log('File exists')
}
```

###### Check file or dir exists shorthand

```js
import FireFS from 'firescript-firefs'

const content = await FireFS.pathExists('/foo/bar/blub')
```

#### Read file

```js
import FireFS from 'firescript-firefs'

const fs = await FireFS.file('/foo/bar/blub')
const content = await fs.read()
```

###### Read file shorthand

```js
import FireFS from 'firescript-firefs'

const content = await FireFS.readFile('/foo/bar/blub')
```

#### Write file

```js
import FireFS from 'firescript-firefs'

const fs = await FireFS.file('/foo/bar/blub')
await fs.write('Content')
```

###### Write file shorthand

```js
import FireFS from 'firescript-firefs'

const fs = await FireFS.writeFile('/foo/bar/blub', 'Content')
```

#### Read JSON file

```js
import FireFS from 'firescript-firefs'

const fs = await FireFS.file('/foo/bar/blub.json')
const json = await fs.readJSON()
```

###### Read JSON file shorthand

```js
import FireFS from 'firescript-firefs'

const json = await FireFS.readJSON('/foo/bar/blub.json')
```

#### Write JSON file

```js
import FireFS from 'firescript-firefs'

const fs = await FireFS.file('/foo/bar/blub')
await fs.writeJSON('Content')
```

###### Write JSON file shorthand

```js
import FireFS from 'firescript-firefs'

const fs = await FireFS.writeJSON('/foo/bar/blub', 'Content')
```


#### Check whether a file or dir exists

*returns* **bool** `true` if path exists, otherwise `false`

```js
import FireFS from 'firescript-firefs'

const exists = await FireFS.pathExists('/foo/bar/blub')
```

#### Read dir

```js
import FireFS from 'firescript-firefs'

const fs = await FireFS.dir('/foo/bar/blub')
const content = await fs.list()
```

###### Read dir shorthand

```js
import FireFS from 'firescript-firefs'

const content = await FireFS.readDir('/foo/bar/blub')
```



#### Watch file

```js
import FireFS from 'firescript-firefs'

const fs = await FireFS.file('/foo/bar/blub/foo.txt')
const content = await fs.watch((fl) => {
  console.log(`File ${fl.name} changed`)
})
```

#### Watch dir

```js
import FireFS from 'firescript-firefs'

const fs = await FireFS.dir('/foo/bar/blub/')
const content = await fs.watch((fl) => {
  console.log(`File ${fl.name} changed`)
})
```

---
_Source: https://npm.io/package/firescript-firefs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
