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

fie-fs

v3.1.4

Published

fie 文件操作模块

Downloads

77

Readme

fie-fs

NPM version David deps Known Vulnerabilities npm download

fie 文件及文件夹操作模块,一般用于套件中的模板生成及变量替换

安装

npm install fie-fs --save

API

copyDirectory(options)

复制目录, 支持 underscore 模板引擎, 标签开始和结束符是: <{% %}>

  • options object
  • options.src string 绝对路径
  • options.dist string 绝对路径
  • options.data string 需要替换变量的数据
  • options.ignore array 数组, 类似 gitignore 的写法
  • options.templateSettings object, 默认是 { evaluate: /<{%([\s\S]+?)%}>/g, interpolate: /<{%=([\s\S]+?)%}>/g, escape: /<{%-([\s\S]+?)%}>/g }

copyTpl(options)

复制文件, 支持 underscore 模板引擎, 标签开始和结束符是: <{% %}>

  • options object
  • options.src string 绝对路径
  • options.dist string 绝对路径
  • options.data object 需要替换变量的数据
  • options.stringReplace 数组 , 将文件里面匹配到的字符串替换掉,如 [{ placeholder: 'PLACEHOLDER', value: 'theReplaceValue' }]

rewriteFile(options)

重写文件内容, 本文件不提供读写文件能力,

  • options object
  • options.hook string 判断需要插入行的标记
  • options.insertLines array 数组类型, 每一项为新行
  • options.place string before / after(默认)
  • options.noMatchActive string top / bottom / null(默认)

move(srcPath, distPath)

移动文件

  • srcPath string 源文件,绝对路径
  • distPath string 目标文件,绝对路径

remove(file)

删除文件或目录

  • file string 需要删除的文件路径

Support

使用过程中遇到的相关问题,及BUG反馈,可联系: hugohua [email protected] ,也可直接提issues

License

GNU GPLv3