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

fsd-fs

v0.15.0

Published

File system adapter for fsd

Readme

fsd-fs

FSD 本地文件系统适配器 - 提供对服务器磁盘文件的读写访问。

npm version

概述

fsd-fsfsd 核心库的本地文件系统适配器,提供完整的文件和目录操作能力。

核心特性

  • ✅ 完整的文件读写操作
  • ✅ 目录管理(创建、删除、遍历)
  • ✅ 流式读写(大文件处理)
  • ✅ 分段上传(大文件优化)
  • ✅ 递归目录列表
  • ✅ Glob 模式匹配
  • ✅ 文件权限控制
  • ✅ 并发控制优化

安装

npm install fsd-fs

配置

import FSD from 'fsd';
import FSAdapter from 'fsd-fs';

// 创建适配器
const adapter = new FSAdapter({
  root: '/app/uploads',        // 必需:本地存储根路径
  mode: 0o644,                  // 可选:创建文件权限(默认 0o644)
  tmpdir: '/tmp/fsd-multipart', // 可选:临时目录(分段上传时使用,默认系统临时目录)
  urlPrefix: 'https://cdn.example.com' // 可选:URL 前缀(生成访问链接时使用)
});

// 创建 FSD 实例
const fsd = FSD({ adapter });

配置选项说明

| 选项 | 类型 | 必需 | 默认值 | 说明 | |------|------|------|--------|------| | root | string | 是 | - | 本地存储根路径,所有文件操作限制在此目录下 | | mode | number | 否 | 0o644 | 创建文件时的权限模式(八进制) | | tmpdir | string | 否 | os.tmpdir() | 分段上传时的临时文件存储目录 | | urlPrefix | string | 否 | - | URL 前缀,用于生成访问链接,通常配合 CDN 或反向代理使用 |

文件权限模式

文件权限使用八进制表示法:

| 模式 | 说明 | |------|------| | 0o644 | rw-r--r-- (用户读写,组和其他只读) - 最常用 | | 0o755 | rwxr-xr-x (用户读写执行,组和其他读执行) - 目录常用 | | 0o600 | rw------- (仅用户可读写) - 敏感文件 | | 0o666 | rw-rw-rw- (用户、组、其他都可读写) - 默认值 |

权限位说明:

  • 4 = read (读)
  • 2 = write (写)
  • 1 = execute (执行)
  • 0 = 无权限

示例 0o644:

  • 用户: 4+2+0 = 6 (rw)
  • 组: 4+0+0 = 4 (r--)
  • 其他: 4+0+0 = 4 (r--)

License

MIT