Giter Site home page Giter Site logo

asyncfiles's Introduction

AsyncFiles

同步更新两个路径下的文件或者文件夹内容

安装

# 全局安装
npm i -g @chrissong/asyncfiles

# 项目依赖
npm i @chrissong/asyncfiles

使用

支持命令行和 AsyncFiles 实例调用两种方式

命令行

Usage: asyncFiles.js <命令> [选项]

命令:
  asyncFiles.js afs  同步文件

选项:
  -v, --version        显示版本号                                         [布尔]
  -s, --source         源文件路径                                [字符串] [必需]
  -t, --target         待同步文件路径                            [字符串] [必需]
  -w, --watch          是否开启监听                       [布尔] [默认值: false]
  -i, --ignoreInitial  是否忽略初始化拷贝                 [布尔] [默认值: false]
  -h, --help           显示帮助信息                                       [布尔]

AsyncFiles 实例

// 创建AsyncFiles实例
const asyncFiles = new AsyncFiles({ source, target, watch, ignoreInitial });

// 关闭监听,当属性watch为true有效
asyncFiles.close();

Options

  • source: String 源文件路径
  • target: String 待同步文件路径
  • watch: Boolean 是否开启监听
  • ignoreInitial: Boolean 是否忽略初始化拷贝

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.