Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ironsource/node-vinyl-fs-merge
https://github.com/ironsource/node-vinyl-fs-merge
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ironsource/node-vinyl-fs-merge
- Owner: ironSource
- License: mit
- Created: 2016-04-14T11:15:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-06T15:30:18.000Z (over 8 years ago)
- Last Synced: 2024-08-08T20:55:26.358Z (3 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# vinyl-fs-merge
**Merges file globs from two or more source directories. First source takes precedence over the next.**
[![npm status](http://img.shields.io/npm/v/vinyl-fs-merge.svg?style=flat-square)](https://www.npmjs.org/package/vinyl-fs-merge) [![node](https://img.shields.io/node/v/vinyl-fs-merge.svg?style=flat-square)](https://www.npmjs.org/package/vinyl-fs-merge)
## example
```js
const merge = require('vinyl-fs-merge')
, gulp = require('gulp')
, imagemin = require('gulp-imagemin')merge(['./my-brand', './default'], '*.png')
.pipe(imagemin())
.pipe(gulp.dest('dist'))
```If both directories have a `logo.png`, then only `my-brand/logo.png` is copied to `dist`. If `my-brand/logo.png` does not exist, `default/logo.png` is copied instead.
## `merge(paths, glob, [options])`
- **paths**: array of source directories
- **glob**: one or more glob patterns passed to [vinyl-fs](https://github.com/gulpjs/vinyl-fs) (must be relative)Options:
- **read**: if false, do not read file contents
- **cwd**: custom working directory to resolve source paths
- Other options are passed to `vinyl-fs`, except:
- `cwd` is set to a resolved source path
- `allowEmpty` is always true (meaning it doesn't fail on a singular glob)## install
With [npm](https://npmjs.org) do:
```
npm install vinyl-fs-merge
```## license
[MIT](http://opensource.org/licenses/MIT) © ironSource.