npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gulp-mark

v0.0.2

Published

Mark files

Downloads

6

Readme

gulp-mark NPM version

gulp plugin to mark files.

Install with npm

npm install gulp-mark

Usage

var mark = require('gulp-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.src('src/**/*.js')
    .pipe(mark.set('script'))
    .pipe(mark.set('config', '/config.js'));
    
var styleStream = gulp.src('src/**/*.css')
    .pipe(mark.set('style'));
      
var finalStream = merge(scriptStream, stylesStream);
  
//Now you can process different types of files in one stream
finalStream.pipe(through.obj(function(file, enc, callback) {
    if (file.mark === 'script') {
        ...
    }
    if (file.mark === 'config') {
        ...
    }
    if (file.mark === 'style') {
        ...
    }
    
    ...
}))

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
    .pipe(mark.if('script', uglify()))
    .pipe(mark.if('style', cssmin()))

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

series(scriptsStream, templatesStream, configStream, stylesStream) //merged by order
    .pipe(mark.after('template', mark.if('config', gulpAmd({add: 'module/templates'}))));
    //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
    .pipe(mark.concat([
        {path: 'script.js', marks: ['script', 'template', 'config']},
        {path: 'style.css', marks: 'style'}
    ]))
    //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.obj();
var templateStream = through.obj();
var styleStream    = through.obj();

gulp.src('src/**/*')
    .pipe(mark.set('script',   '.js'))
    .pipe(mark.set('template', '.html'))
    .pipe(mark.set('style',    '.css'))
    .pipe(mark.separate(
        ['script',     'template',     'style'],
        [scriptStream, templateStream, styleStream]
    ));
//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