0.3.1 • Published 9 years ago

node-merge-collect-files v0.3.1

Weekly downloads
635
License
ISC
Repository
github
Last release
9 years ago

node-merge-collect-files

Description

Node module to merge two or more directories and collect the filenames.
Files can be optionally filtered using a glob pattern.

Usage

To install this module in your current working directory (which should already contain a package.json), run

npm install node-merge-collect-files

You can additionally just list the module in your package.json and run npm install.

Then, require this package where you need it:

var mergeCollectFiles = require('node-merge-collect-files');

The syntax for collecting merged files of two or more directories is as follows:

var files = mergeCollectFiles( [ 'directory-one', 'directory-two' ], '**/*.json' );

The glob pattern can also be an array.

var files = mergeCollectFiles( [ 'directory-one', 'directory-two' ], ['**/*.json', '**/*.js'] );

If you would like to pass some glob options, use the third parameter.

var files = mergeCollectFiles( [ 'directory-one', 'directory-two' ], ['**/*.json', '**/*.js'], { dot: false } );

The default glob options are:

{
	cwd: basePath,
	nonull: false,
	dot: true
}

Example

http://runnable.com/VL4rxq7sBR8spJf2/node-merge-collect-files-example-for-node-js

Release History

0.3.1

  • Fixed patterns param in glob.sync to be local copy of patterns as glob.sync seems to mutate this param.

0.3.0

  • Added support for setting glob options.

0.2.3

  • Fixed version reference of glob-all.

0.2.2

  • Removed reference to multiglob.

0.2.1

  • Removed reference to multiglob.

0.2.0

  • Added support for multiple glob patterns.

0.1.0

  • Defined mergeCollectFiles method.
0.3.1

9 years ago

0.3.0

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago