gulp-mark
gulp plugin to mark files.
npm
Install withnpm install gulp-mark
Usage
var mark = ;
API
mark.set(mark [, pathToken])
Set attribute mark
to vinyl file object. You can read the value as file.mark
.
Parameters
mark
Type: String
Value of mark
attribute.
pathToken
Type: String
Set mark
if file.path
contain pathToken
substring.
Usage
var scriptStream = gulp ; var styleStream = gulp ; var finalStream = ; //Now you can process different types of files in one streamfinalStream
mark.if(mark, stream [, elseStream])
It is gulp-if for marked files.
It will pipe data to stream for files whenever mark
equivalent to file.mark
.
If mark
is not equivalent and elseStream is passed, data will pipe to elseStream.
After data is piped to stream or elseStream or neither, data is piped down-stream.
Parameters
mark
Type: String
Condition for mark
attribute.
stream
Type: Stream
Stream for mark.if
to pipe data into when conditon is truthy.
elseStream
Type: Stream
Optional, Stream for mark.if
to pipe data into when condition is falsey.
Usage
finalStream
mark.after(mark, stream [, elseStream])
As mark.if
but pipe data to stream for all subsequent files whenever mark
equivalent to file.mark
.
Parameters
mark
Type: String
Condition for mark
attribute.
stream
Type: Stream
Stream for mark.after
to pipe data into when conditon is truthy.
elseStream
Type: Stream
Optional, Stream for mark.after
to pipe data into when condition is falsey.
Usage
//merged by order ; //if files marked as 'template' is in final stream we add 'module/templates' dependency //to next config files (if they exists)
mark.concat(files)
This will concat marked files by your operating systems newLine as gulp-concat.
Parameters
files
Type: Array
Array of objects with params of each output file like {path: 'script.js', marks: ['script', 'config']}
.
path
- name of the merged file, marks
- mark or array of marks.
This means that we will get the file script.js
consisting of the files marked as script
and config
in the output stream.
Usage
finalStream //we will have two files `script.js` and `style.css` in the output stream
mark.separate(marks, streams)
Splits the stream with marked files into several streams
Parameters
marks
Type: String
or Array
of strings
mark or array of marks
streams
Type: Stream
or Array
of streams
stream or array of streams which corresponding marks
Usage
var scriptStream = through;var templateStream = through;var styleStream = through; gulp ;//we will have `scriptsStream` with js-files, `templateStream` with html-files//and `styleStream` with css-files
License
Copyright (c) 2014-2015 Oleg Istomin Released under the MIT license