Skip to content

Latest commit

 

History

History
52 lines (32 loc) · 2.05 KB

README.md

File metadata and controls

52 lines (32 loc) · 2.05 KB

Writing a plugin

If you plan to create your own Gulp plugin, you will save time by reading the full documentation.

What it does

### Streaming file objects

A gulp plugin always returns a stream in object mode that does the following:

  1. Takes in vinyl File objects
  2. Outputs vinyl File objects

These are known as transform streams (also sometimes called through streams). Transform streams are streams that are readable and writable which manipulate objects as they're being passed through.

Modifying file content

Vinyl files can have 3 possible forms for the contents attribute:

  • Streams
  • Buffers
  • Empty (null) - Useful for things like rimraf, clean, where contents is not neeeded.

Useful resources

Sample plugins

About streams

If you're unfamiliar with streams, you will need to read up on them:

Other libraries that are not file manipulating through streams but are made for use with gulp are tagged with the gulpfriendly keyword on npm.