1.1.0 • Published 4 years ago

fs-copydir v1.1.0

Weekly downloads
-
License
BSD-3-Clause
Repository
gitlab
Last release
4 years ago

fs-copydir

version license downloads install size coffee

快速使用

SHELL

$ tnpx @alife/fs-copydir ./abc ./dist

NODE API

$ tnpm install --save @alife/fs-copydir
const { dirCopy } = require('@alife/fs-copydir');

dirCopy({
  src: '源目录',
  dist: '目标目录'
});

OPTIONS

interface OptionsShape {
  /** 源目录 */
  src: string;
  /** 目标目录 */
  dist: string;
  /** 文件内容关键词替换 */
  replacer?: Replacer[];
  /** 忽略掉的文件 */
  exclude?: RegExp;
  /** 只读文件,直接复制 */
  readonlyFile?: RegExp;
  /** 文件名替换方法 */
  fileNameTransfer?: (name: string) => string;
  /** 文件内容替换方法 */
  contentFormatter?: (fileContent: string, curSrcPath: string) => string | Promise<string>;
}

LICENSE

BSD-3-Clause License

1.1.0

4 years ago