Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
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.

Source
npmnpm
Version
0.2.1
Version published
Weekly downloads
1.5K
-3.25%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-dest NPM version

Gulp plugin for easily defining destination paths.

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:

Example

// Given: ['a.coffee', 'b.coffee', 'c.coffee']

dest(':basename.js');
//=> ['a.js', 'b.js', '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.txt', 'b.txt', 'c.txt'])
    // basename is automatically generated from the file,
    // unless overridden in the options
    .pipe(dest('dist/:basename.:a:b:c', {a: 'A', b: 'B', c: 'C'}))
    .pipe(gulp.dest('./'))
});

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

Run tests

Install dev dependencies:

node i -d && mocha

Contributing

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

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert
Released under the MIT license

This file was generated by verb on December 30, 2014.

Keywords

dest

FAQs

Package last updated on 30 Dec 2014

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