vinyl-paths

WebJar for vinyl-paths

Лицензия

Лицензия

MIT
Категории

Категории

Github Инструменты разработки Контроль версий
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

github-com-sindresorhus-vinyl-paths
Последняя версия

Последняя версия

2.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

vinyl-paths
WebJar for vinyl-paths
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/sindresorhus/vinyl-paths

Скачать github-com-sindresorhus-vinyl-paths

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-sindresorhus-vinyl-paths/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-sindresorhus-vinyl-paths</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-sindresorhus-vinyl-paths/
implementation 'org.webjars.npm:github-com-sindresorhus-vinyl-paths:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-sindresorhus-vinyl-paths/
implementation ("org.webjars.npm:github-com-sindresorhus-vinyl-paths:2.1.0")
'org.webjars.npm:github-com-sindresorhus-vinyl-paths:jar:2.1.0'
<dependency org="org.webjars.npm" name="github-com-sindresorhus-vinyl-paths" rev="2.1.0">
  <artifact name="github-com-sindresorhus-vinyl-paths" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-sindresorhus-vinyl-paths', version='2.1.0')
)
libraryDependencies += "org.webjars.npm" % "github-com-sindresorhus-vinyl-paths" % "2.1.0"
[org.webjars.npm/github-com-sindresorhus-vinyl-paths "2.1.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.npm : through2 jar [2.0.0,3)

Модули Проекта

Данный проект не имеет модулей.

vinyl-paths Build Status

Get the file paths in a vinyl stream

Useful when you need to use the file paths from a Gulp pipeline in an async Node.js package.

Simply pass an async function such as del and this package will provide each path in the stream as the first argument.

Install

$ npm install vinyl-paths

Usage

// gulpfile.js
const gulp = require('gulp');
const stripDebug = require('gulp-strip-debug');
const del = require('del');
const vinylPaths = require('vinyl-paths');

// Log file paths in the stream
gulp.task('log', =>
	gulp.src('app/*')
		.pipe(stripDebug())
		.pipe(vinylPaths(async paths => {
			console.log('Paths:', paths);
		})
);

// Delete files in the stream
gulp.task('delete', =>
	gulp.src('app/*')
		.pipe(stripDebug())
		.pipe(vinylPaths(del))
);

// Or if you need to use the paths after the pipeline
gulp.task('delete2', =>
	new Promise(function (resolve, reject) {
		const vp = vinylPaths();

		gulp.src('app/*')
			.pipe(vp)
			.pipe(gulp.dest('dist'))
			.on('end', async () => {
				try {
					await del(vp.paths);
					resolve();
				} catch (error) {
					reject(error);
				}
			});
	})
);

You should only use a vanilla Node.js package like this if you're already using other plugins in the pipeline, otherwise just use the module directly as gulp.src is costly. Remember that Gulp tasks can return promises as well as streams!

API

vinylPaths(callback?)

The optional callback will receive a file path for every file and is expected to return a promise. An array of the file paths so far is available as a paths property on the stream.

callback(path)

Related

Версии библиотеки

Версия
2.1.0