- Notifications
You must be signed in to change notification settings - Fork2
Engine to create Gulp plugins for unified
License
unifiedjs/unified-engine-gulp
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
unified engine to create aGulp plugin from a unifiedprocessor.
- What is this?
- When should I use this?
- Install
- Use
- API
- Debugging
- Types
- Compatibility
- Security
- Contribute
- License
This package wrapsunified-engine
so that it can be usedto create a Gulp plugin.It’s what you use underneath when you usegulp-remark
.
You can use this to let users process files from a gulp plugin, letting themconfigure from the file system.
This package isESM only.In Node.js (version 16+), install withnpm:
npm install unified-engine-gulp
import{remark}from'remark'import{engineGulp}from'unified-engine-gulp'exportconstgulpRemark=engineGulp({ignoreName:'.remarkignore',name:'gulp-remark',packageField:'remarkConfig',pluginPrefix:'remark',processor:remark,rcName:'.remarkrc'})
This package exports the identifierengineGulp
.There is no default export.
Create aGulp plugin.
👉Note: seewriting a Gulp plugin for more info.
options
(Options
, required])— configuration
Gulp plugin, which can be called with options (same asOptions
but w/oname
orprocessor
) and returns athrough2
streamaccepting Vinyl files (FileStream
).
File stream (TypeScript type).
Streaming vinyl files are not supported.Read more about why inGulp’s docs (point 10).
There’s also afileStream.use()
function, which is likeunified.use()
, in that it accepts a plugin and configuration or apreset.It returns the operated onfileStream
.
importtype{Transform}from'node:stream'typeFileStream=Transform&{use:Use}typeUse=(...values:unknown[])=>FileStream
Configuration (TypeScript type).
importtype{EngineOptions}from'unified-engine'typeOptions={name:string}&Omit<EngineOptions,|'alwaysStringify'|'cwd'|'extensions'|'files'|'out'|'output'|'plugins'|'silentlyIgnore'|'streamIn'|'streamOut'>
The engine can be debugged by setting theDEBUG
environment variableto*
, such asDEBUG="*" gulp …
.
This package is fully typed withTypeScript.It exports the additional typesFileStream
andOptions
.
Projects maintained by the unified collective are compatible with maintainedversions of Node.js.
When we cut a new major release, we drop support for unmaintained versions ofNode.This means we try to keep the current release line,unified-engine-gulp@^11
,compatible with Node.js 16.
unified-engine-gulp
loads and evaluates configuration files, plugins, andpresets from the file system (often fromnode_modules/
).That means code that is on your file system runs.Make sure you trust the workspace where you rununified-engine-gulp
and becareful with packages from npm and changes made by contributors.
Seecontributing.md
inunifiedjs/.github
for waysto get started.Seesupport.md
for ways to get help.
This project has acode of conduct.By interacting with this repository, organization, or community you agree toabide by its terms.
About
Engine to create Gulp plugins for unified