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 🙏

© 2024 – Pkg Stats / Ryan Hefner

better-fs

v11.0.4

Published

provide fast and easy file system api

Downloads

46

Readme

特点

  1. 基于graceful-fs,更可靠
  2. 提供全部fsnative 方法,部分原生回调方式改为 promise
  3. 提供 copy,remove,move 等实用方法的异步和同步调用
  4. 全部用 typescript 开发,可靠性高,vscode智能提示支持
  5. 全部 api 有 jest 单元测试,测试覆盖率如下图

使用

typescript

import * as fs from 'better-fs'
fs.copy()
fs.remove()
......

node

const fs = require('better-fs');
fs.copy()
fs.remove()
......

api

全部 fs 默认 api,改变下面原生方法返回值为 promise

lstat,
readdir,
rename,
unlink,
writeFile,
readFile,

开发下面方法,返回值 promise.方法名+Sync 可调用同步方法

copy

复制目录,文件到目标地址

ensureWriteFile

写文件,如果目标文件目录不存在,会自动创建目录

isExist

文件是否存在

ensureMkdir

类似 mkdir -p

move

移动目录,文件到指定地点或重命名

pipe

输入 src 和 dest 文件地址,执行 stream pipe,返回 promsie

readInclude

读取目标目录下的所有目录,文件

remove

移除目标目录,文件夹