Script to copy javascript files and append ".flow" to the filename
Clone or download
Latest commit b8d0775 Jul 19, 2018
Failed to load latest commit information.
.circleci Add circleci config. Jun 4, 2018
bin var->let/const Feb 5, 2018
src Add test. Jun 4, 2018
.gitignore initial commit Feb 12, 2016
.npmignore Add test. Jun 4, 2018 Update changelog. Jul 18, 2018
LICENSE.txt 1.0 Feb 12, 2016 capitalize like a cool person Jun 5, 2018
package.json 2.0.2 Jul 18, 2018
yarn.lock chore(package): update lockfile Jul 17, 2018


GitHub license npm version CircleCI Status Greenkeeper badge

This is a simple script which finds all .js, .jsx, and .mjs files in one or more source directories, and copies them into a destination directory with the .flow suffix appended to the filename.

This is intended to be used as a build step for Flow-typed Javascript projects so that the original typed source files can be placed in the same directory as the transpiled code, so that Flow can use the type definitions in the original source code.

Usage: bin/flow-copy-source.js [-v|--verbose] [-w|--watch] [-i PATTERN]... SRC... DEST

  -v, --verbose  Show changes                                          [boolean]
  -w, --watch    Re-copy files on change                               [boolean]
  -i, --ignore   ignore pattern (glob expression)

Multiple --ignore patterns may be given by using the --ignore option multiple times.

This module also exports the flowCopySource(sources, dest, options) function. sources must be an array of strings, dest must be a string, and options may optionally be an object with optional verbose and watch boolean properties. The function returns a promise for an array of {src, dest} objects listing the operations done.