# gulp-dest

> Gulp plugin for easily defining destination paths using path variables.

Latest version **0.2.3** (published 2015-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-dest
pnpm add gulp-dest
yarn add gulp-dest
bun add gulp-dest
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2015-10-27 |
| First published | 2014-12-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | dest, destination, directory, file, filepath, fs, gulpplugin, path |

## Links

- npm: https://www.npmjs.com/package/gulp-dest
- Repository: https://github.com/jonschlinkert/gulp-dest
- Issues: https://github.com/jonschlinkert/gulp-dest/issues
- npm.io page: https://npm.io/package/gulp-dest

## Dependencies (7)

- [through2](https://npm.io/package/through2.md) ^2.0.0
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.7
- [lazy-cache](https://npm.io/package/lazy-cache.md) ^0.2.4
- [rewrite-ext](https://npm.io/package/rewrite-ext.md) ^0.2.0
- [placeholders](https://npm.io/package/placeholders.md) ^0.2.0
- [extend-shallow](https://npm.io/package/extend-shallow.md) ^2.0.1
- [parse-filepath](https://npm.io/package/parse-filepath.md) ^0.6.3

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.2.3 (latest) — 2015-10-27
- 0.2.2 — 2015-02-22
- 0.2.1 — 2014-12-30
- 0.2.0 — 2014-12-30

## README

# gulp-dest [![NPM version](https://badge.fury.io/js/gulp-dest.svg)](http://badge.fury.io/js/gulp-dest)

> Gulp plugin for easily defining destination paths using path variables.

Install with [npm](https://www.npmjs.com/)

```sh
$ npm i gulp-dest --save
```

## Example

```js
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

```js
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**

```js
// 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**

```js
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']
```

## Related projects

* [gulp-assemble](https://www.npmjs.com/package/gulp-assemble): Gulp plugin for Assemble. | [homepage](http://assemble.io)
* [gulp-drafts](https://www.npmjs.com/package/gulp-drafts): Gulp plugin for removing files flagged as drafts. Can also be used as an assemble… [more](https://www.npmjs.com/package/gulp-drafts) | [homepage](https://github.com/jonschlinkert/gulp-drafts)
* [gulp-extname](https://www.npmjs.com/package/gulp-extname): gulp plugin to dynamically rewrite dest extensions based on src extensions. | [homepage](https://github.com/jonschlinkert/gulp-extname)
* [gulp-routes](https://www.npmjs.com/package/gulp-routes): Add middleware to run for specified routes in your gulp pipeline. | [homepage](https://github.com/assemble/gulp-routes)

## Running tests

Install dev dependencies:

```sh
$ npm i -d && npm test
```

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/gulp-dest/issues/new).

## Author

**Jon Schlinkert**

+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License

Copyright © 2015 Jon Schlinkert
Released under the MIT license.

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 27, 2015._

---
_Source: https://npm.io/package/gulp-dest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
