unified

Project:unifiedjs/unified-engine-gulp

Package:unified-engine-gulp@7.0.0

  1. Dependencies:6·Dependents:2
  2. unified engine to create a Gulp plugin from a processor
  1. remark 170
  2. unified 132
  3. rehype 76
  4. retext 38
  5. engine 4
  6. processor 4
  7. gulp 2

unified-engine-gulp

Build Coverage Downloads Sponsors Backers Chat

unified engine to create a Gulp plugin from a processor. Wrapper around unifiedjs/unified-engine.

Install

npm:

npm install unified-engine-gulp

Use

var engine = require('unified-engine-gulp')

module.exports = engine({
  name: 'gulp-remark',
  processor: require('remark'),
  rcName: '.remarkrc',
  packageField: 'remarkConfig',
  ignoreName: '.remarkignore',
  pluginPrefix: 'remark'
})

API

engine(options)

Create a Gulp plugin from a processor. Read more about creating Gulp plugins ».

options

Anything not set in options, but in the below list, can be set later by users of the plugin.

options.name (string, required)

Name of Gulp plugin (used in errors).

options.processor

Unified processor to transform files (Processor, required).

options.streamError

Stream to write the report (if any) to (WritableStream, default: process.stderr).

options.tree

Whether to treat both input and output as a syntax tree (boolean, default: false).

options.treeIn

Whether to treat input as a syntax tree (boolean, default: tree).

options.treeOut

Whether to treat output as a syntax tree (boolean, default: tree).

options.inspect

Skip the compilation phase and output a syntax tree formatted with unist-util-inspect (boolean, default: false).

options.rcName

Name of configuration files to load (string, optional).

options.packageField

Property at which configuration can be found in package.json files (string, optional).

options.detectConfig

Whether to search for configuration files (boolean, default: whether rcName or packageField is given).

options.rcPath

File-path to a configuration file to load (string, optional).

options.settings

Configuration for the parser and compiler of the processor (Object, optional).

options.ignoreName

Name of ignore files to load (string, optional).

options.detectIgnore

Whether to search for ignore files (boolean, default: whether ignoreName is given).

options.ignorePath

File-path to an ignore file to load (string, optional).

options.plugins

Map of plug-in names or paths and options to use (Object, optional).

options.pluginPrefix

When given, optional prefix to use when searching for plug-ins (string, optional).

options.defaultConfig

Optional object with plugins and/or settings to use if no config file is supplied by the user (Object, optional).

options.configTransform

Transform config files from a different schema (Function, optional).

options.reporter

Reporter to use (string or function, default: require('vfile-reporter')).

options.reporterOptions

Config to pass to the used reporter (Object?, optional).

options.color

Whether to report with ANSI colour sequences (boolean, default: false).

options.silent

Report only fatal errors (boolean, default: false).

options.quiet

Do not report successful files (boolean, default: silent).

options.frail

Treat warnings as errors (boolean, default: false).

Returns

A standard through2 object stream, accepting Vinyl files (fileStream). Streaming vinyl files are not supported. Read more about why in Gulp’s docs (point 10).

There’s also a fileStream.use() function, which mimics unified.use() in that it accepts a plugin and configuration. It returns the operated on fileStream.

Contribute

See contributing.md in unifiedjs/.github for ways to get started. See support.md for ways to get help.

This project has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer