Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Engine to create Gulp plugins for unified

License

NotificationsYou must be signed in to change notification settings

unifiedjs/unified-engine-gulp

Repository files navigation

BuildCoverageDownloadsSponsorsBackersChat

unified engine to create aGulp plugin from a unifiedprocessor.

Contents

What is this?

This package wrapsunified-engine so that it can be usedto create a Gulp plugin.It’s what you use underneath when you usegulp-remark.

When should I use this?

You can use this to let users process files from a gulp plugin, letting themconfigure from the file system.

Install

This package isESM only.In Node.js (version 16+), install withnpm:

npm install unified-engine-gulp

Use

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'})

API

This package exports the identifierengineGulp.There is no default export.

engineGulp(options)

Create aGulp plugin.

👉Note: seewriting a Gulp plugin for more info.

Parameters
  • options (Options, required])— configuration
Returns

Gulp plugin, which can be called with options (same asOptionsbut w/oname orprocessor) and returns athrough2 streamaccepting Vinyl files (FileStream).

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.

Type
importtype{Transform}from'node:stream'typeFileStream=Transform&{use:Use}typeUse=(...values:unknown[])=>FileStream

Options

Configuration (TypeScript type).

Type
importtype{EngineOptions}from'unified-engine'typeOptions={name:string}&Omit<EngineOptions,|'alwaysStringify'|'cwd'|'extensions'|'files'|'out'|'output'|'plugins'|'silentlyIgnore'|'streamIn'|'streamOut'>

Debugging

The engine can be debugged by setting theDEBUG environment variableto*, such asDEBUG="*" gulp ….

Types

This package is fully typed withTypeScript.It exports the additional typesFileStream andOptions.

Compatibility

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.

Security

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.

Contribute

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.

License

MIT ©Titus Wormer


[8]ページ先頭

©2009-2025 Movatter.jp