gp

gulp-path

Creates file's paths in a simple and organized way

Showing:

Popularity

Downloads/wk

807

GitHub Stars

5

Maintenance

Last Commit

4yrs ago

Contributors

2

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

gulp-path

Creates file's paths in a simple and organized way

Install

$ npm install --save-dev gulp-path

Basic usage

You can create simple paths, for input and output, as simple as this.

'use strict';
 
var gulp = require('gulp');
var sass = require('gulp-sass');
var gp = require('gulp-path');
 
var app = new gp.Path('src', 'public');
var styles = app.generateAllPaths('styles', 'css', null, 'sass');
 
gulp.task('sass', function(){
    // ./src/styles/*.sass
    return gulp.src(styles.input)
        .pipe(sass())
        // ./public/css
        .pipe(styles.output);
});

You can also create simple blob paths

'use strict';
 
var gulp = require('gulp');
var sass = require('gulp-sass');
var gp = require('gulp-path');
 
var input = gp.generateBlob('src', 'components', '*', 'sass');
var output = gp.generateBlob('public', 'components', null, null);

gulp.task('sass', function(){
    // ./src/styles/*.sass
    return gulp.src(input)
        .pipe(sass())
        // ./public/css
        .pipe(output);
});

Documentation

Path(input [, output = input, sub-path = null])

All parameters of Path are waiting a string or an array. In that way, you can have a simple path, multiple paths, or a composed path.

input <String|Array>

A property with the input path(s)

output <String|Array>

A property with the output path(s)

#createSubPath(subPaths)

Creates a new Path instance based on the previous path.

#generateAllPaths(subPathsInput, subPathsOutput, files, extensions)

Generates all paths, an object that holds input and output only, based on the params and base path.

#generateInput(subPaths, files, extensions)

Generates all input paths based on the params and base path.

#generateOutput(subPaths)

Generates all output paths based on the params and the base path.

generateBlob([bases = './', paths = '', files = '', extensions = ''])

Generates a blob of paths

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial