unified

Project: unifiedjs/unified-engine

Package: unified-engine@8.0.0

  1. Dependencies: 17·Dependents: 17
  2. Engine to process multiple files with unified
  1. unified 152
  2. processor 4
  3. engine 4

unified-engine

Build Coverage Downloads Sponsors Backers Chat

Engine to process multiple files with unified, allowing users to configure from the file system.

Projects

The following projects wrap the engine:

Install

npm:

npm install unified-engine

Use

The following example processes all files in the current directory with a Markdown extension with remark, allows configuration from .remarkrc and package.json files, ignoring files from .remarkignore files, and more.

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

engine(
  {
    processor: remark,
    files: ['.'],
    extensions: ['md', 'markdown', 'mkd', 'mkdn', 'mkdown'],
    pluginPrefix: 'remark',
    rcName: '.remarkrc',
    packageField: 'remarkConfig',
    ignoreName: '.remarkignore',
    color: true
  },
  done
)

function done(error) {
  if (error) throw error
}

Contents

API

engine(options, callback)

Process files according to options and invoke callback when done.

options

function callback(error[, code, context])

Callback invoked when processing according to options is complete. Invoked with either a fatal error if processing went horribly wrong (probably due to incorrect configuration), or a status code and the processing context.

Parameters

Plugins

doc/plugins.md describes in detail how plugins can add more files to be processed and handle all transformed files.

Configuration

doc/configure.md describes in detail how configuration files work.

Ignoring

doc/ignore.md describes in detail how ignore files work.

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, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer