3.0.0 • Published 6 months ago

gulp-chown v3.0.0

Weekly downloads
191
License
MIT
Repository
github
Last release
6 months ago

gulp-chown

Change owner of Vinyl files

Install

npm install --save-dev gulp-chown

Usage

import gulp from 'gulp';
import chown from 'gulp-chown';

export default () => (
	gulp.src('src/app.js')
		.pipe(chown('sindresorhus'))
		.pipe(gulp.dest('dist'))
);

or

import gulp from 'gulp';
import chown from 'gulp-chown';

export default () => (
	gulp.src('src/app.js')
		.pipe(chown(501))
		.pipe(gulp.dest('dist'))
);

API

chown(userId, groupId)

The arguments must be of the same type.

userId

Required\ Type: string | number

The user name or user id to change ownership to.

groupId

Type: string | number

The group name or group id to change ownership to.

Tip

Combine it with gulp-filter to only change ownership of a subset of the files.

import gulp from 'gulp';
import chown from 'gulp-chown';
import gFilter from 'gulp-filter';

const filter = gFilter('src/vendor-*.js');

export default () => (
	gulp.src('src/*.js')
		// Filter a subset of the files
		.pipe(filter)
		// Change ownership of them
		.pipe(chown('sindresorhus'))
		// Bring back the previously filtered out files
		.pipe(filter.restore())
		.pipe(gulp.dest('dist'))
);

Related

3.0.0

6 months ago

2.0.0

6 years ago

1.1.0

9 years ago

1.0.3

9 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago