npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rescript-tauri/plugin-fs

v0.1.1

Published

ReScript bindings for @tauri-apps/plugin-fs (Tauri 2.x filesystem plugin)

Readme

@rescript-tauri/plugin-fs

ReScript bindings for @tauri-apps/plugin-fs — Tauri 2.x's filesystem plugin.

Status

Phase 2, first iteration. Awaiting first npm publish (plugin-fs-v0.1.0).

Bundled in this iteration: 14 single-shot IO functions (readTextFile / writeTextFile / readFile / writeFile / exists / remove / rename / mkdir / readDir / stat / lstat / truncate / copyFile / size) plus their record types.

Deferred to follow-up sub-steerings:

  • FileHandle class (open / create + instance methods)
  • watch / watchImmediate + WatchEvent variant tree
  • readTextFileLines (AsyncIterable return)
  • iOS-only security-scoped resource APIs

Install (planned)

pnpm add @rescript-tauri/plugin-fs @rescript-tauri/core @tauri-apps/plugin-fs @tauri-apps/api

Add to rescript.json:

{
  "dependencies": ["@rescript/core", "@rescript-tauri/core", "@rescript-tauri/plugin-fs"]
}

Quick example

module Fs = RescriptTauriPluginFs.PluginFs
module Path = RescriptTauriCore.Path

let main = async () => {
  // Resolve to $APPCONFIG/notes.txt and write
  await Fs.writeTextFile(
    "notes.txt",
    "hello, ReScript",
    ~options={baseDir: Path.BaseDirectory.appConfig},
  )

  // Read it back
  let body = await Fs.readTextFile(
    "notes.txt",
    ~options={baseDir: Path.BaseDirectory.appConfig},
  )
  Console.log(body)
}

Compatibility

| Component | Supported range | |---|---| | @rescript-tauri/plugin-fs | this package | | @rescript-tauri/core | ^0.1.0 (peer) | | @tauri-apps/plugin-fs | ^2.5.0 (peer) | | @tauri-apps/api | ^2.0.0 (transitive via core) | | Rust tauri-plugin-fs | 2.x | | rescript | >=12.0.0 | | @rescript/core | >=1.6.0 | | OS | Linux / macOS / Windows |

Public API (this iteration)

| Symbol | Purpose | |---|---| | readTextFile / writeTextFile | UTF-8 text round-trip | | readFile / writeFile | Raw bytes round-trip (Uint8Array.t) | | exists | Check whether a path is present | | remove | Remove a file or directory (with optional recursion) | | rename | Move / rename | | mkdir | Create a directory (with optional recursion + mode) | | readDir | Enumerate a directory's children (array<dirEntry>) | | stat / lstat | File metadata (fileInfo); lstat does not follow symlinks | | truncate | Truncate to ~len bytes | | copyFile | Copy a file | | size | Return file size in bytes |

PluginFs.BaseDirectory is re-exported from @rescript-tauri/core's Path.BaseDirectory, so the same numeric-private-int enum is shared across both packages.

See src/PluginFs.resi for full documentation comments and matching upstream URLs.

Pitfalls

  • Single-field record punning: ReScript treats {baseDir} as a block, not a one-field record. Use {baseDir: baseDir} for any single-field option literal. Multi-field option records ({baseDir, recursive: true}) work as expected.
  • Uint8Array length: Uint8Array.t aliases TypedArray.t<int> in @rescript/core; use TypedArray.length(bytes) to read the byte count.

The full user-guide write-up of these pitfalls is in sphinx-docs/user/plugin-fs.md.

See also