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

filecp

v1.0.0

Published

Copy a file

Downloads

6

Readme

L0-R2-T000076

项目编号:
  L0-R2-T000076
项目名称:
  中英文 JSON 合并工具
项目说明:
  NPM 发布一个 LTS 版本查看工具
项目技术栈说明:
  Node.js「学习 fs 文件能力」

fs-文件系统

fs常用API

  • fs.copyFileSync(src, dest[,mode])
  • fs.mkdir(path[,options],callback)
  • fs.mkdirSync(path[,options])
  • fs.readFile(path[,options], callback)
  • fs.readFileSync(path[,options])
  • fs.writeFile(file, data[, options], callback)
  • fs.open(path[,flags[,mode]],callback)
  • fs.read(fd,buffer,offset,length,position,callback)
  • fs.write(fd, buffer, offset, length, position, callback)
  • fs.appendFile(path, data[, options], callback)

开发日志

  1. 搭建骨架
  2. 完成图片的复制
  3. 复制大视频(createReadStream/createWriteStream/pipe)
  4. 边界错误检查
    • source文件不存在提示:文件或文件夹不存在:xx
    • source是文件,复制至target(target缺省默认为:[filename]_copy[ext]
    • 复制成功提示:文件复制成功:v1.mp4 => v1_copy.mp4
    • source是文件夹,复制所有文件和文件夹
  5. 优化提示,等待文件夹整体完成复制再提示成功。

BUG记录

  1. [feat: 复制文件夹]中,只测试了单层目录,多层目录有问题,主要是因为getFiles进行了深层级的查找,去除getFiles逻辑。
  2. copying输出有误,原因是文件拷贝是异步的,在copying中无法串形输出。

实际运行结果

  1. fscp test fscp