Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-plugin-extras

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-plugin-extras

Useful utilities for creating Gulp plugins

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gulp-plugin-extras

Useful utilities for creating Gulp plugins

Install

npm install gulp-plugin-extras

Usage

import {gulpPlugin} from 'gulp-plugin-extras';

export default function gulpFoo() {
	return gulpPlugin('gulp-foo', async file => {
		file.contents = await someKindOfTransformation(file.contents);
		return file;
	});
}

API

gulpPlugin(name, onFile, onFinish?)

Create a Gulp plugin.

This does not support streaming.

name

Type: string

The plugin name.

onFile

Type: async (file) => file

The async function called for each Vinyl file in the stream. Must return a modified or new Vinyl file.

onFinish

Type: async function * (): void

An async generator function executed for finalization after all files have been processed.

You can yield more files from it if needed.

import {gulpPlugin} from 'gulp-plugin-extras';

export default function gulpFoo() {
	return gulpPlugin(
		'gulp-foo',
		async file => { … },
		async function * () {
			yield someVinylFile;
			yield someVinylFile2;
		}
	);
}

Keywords

FAQs

Package last updated on 31 Oct 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc