Socket
Book a DemoInstallSign in
Socket

gulp-dest

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-dest

Gulp plugin for easily defining destination paths using path variables.

latest
Source
npmnpm
Version
0.2.3
Version published
Weekly downloads
707
-0.42%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-dest NPM version

Gulp plugin for easily defining destination paths using path variables.

Install with npm

$ npm i gulp-dest --save

Example

var dest = require('gulp-dest');
var gulp = require('gulp');

gulp.task('default', function() {
  gulp.src(['a.hbs', 'b.hbs', 'c.hbs'])
    .pipe(dest('dist', {ext: '.html'}))
    .pipe(gulp.dest('./'))
});

//=> ['dist/a.html', 'dist/b.html', 'dist/c.html']

Usage

dest(directory, options);

// example
dest('dist', { ext: '.html' });
  • directory {String}: Optionally define a path to be append to the path (file.base) specified in gulp.dest()
  • options {Object}: Pass file path properties to use. Supported properties are ext or extname, dirname and basename (although I'm not sure why you would use it)

Path variables

Dynamically replace variables with actual path values:

Examples

// Given: ['a.coffee', 'b.coffee', 'c.min.coffee']
dest(':name.js');
//=> ['a.js', 'b.js', 'c.min.js']

// Given: ['foo/a.coffee', 'bar/b.coffee', 'baz/c.coffee']
dest('qux/:name.js');
//=> ['qux/a.js', 'qux/b.js', 'qux/c.js']

Any properties defined on the options can be used as path variables:

Example

var dest = require('gulp-dest');
var gulp = require('gulp');

gulp.task('default', function() {
  gulp.src(['a.coffee', 'b.coffee', 'c.coffee'])
    .pipe(dest(':foo/:name.js', {foo: 'bar'}))
    .pipe(gulp.dest('.'))
});

//=> ['bar/a.js', 'bar/b.js', 'bar/c.js']

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.

This file was generated by verb-cli on October 27, 2015.

Keywords

dest

FAQs

Package last updated on 27 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts