Version 1.0.2
@stackline/unified-engine
Process files with unified plugins, configuration, and ignore rules using the unified-engine 10 callback API
Installation
npm install @stackline/unified-engine@1.0.2Node.js: ^20.19.0 || >=22.12.0. Read the compatibility and maintenance notes before migrating.
Usage and API
@stackline/unified-engine
Process files with unified plugins, configuration, and ignore rules using the unified-engine 10 callback API.
Documentation | npm | Issues | Repository
Package version: 1.0.2
Why this package?
Maintained MIT-licensed fork of unified-engine@10.1.0, retaining its callback API and unified 10 / vfile 5 type model. Requires Node.js 20.19+ on the 20.x line, or Node.js 22.12+.
The file finder uses glob 13 with brace-aware magic detection and a Promise-to-callback bridge. @stackline/load-plugin removes obsolete glob/inflight dependencies from the plugin-resolution path while preserving the original options.
Development: npm ci, npm run build, npm test, npm run lint. npm run build validates the preserved published declarations with modern TypeScript; it does not regenerate unrelated legacy JSDoc. See UPSTREAM-TYPES.md. Tests include the upstream integration suite and focused glob regressions.
unified engine to process multiple files, lettings users configure from the file system.
What is this?
This package is the engine.
It’s what you use underneath when you use remark-cli or a
language server.
Compared to unified, this deals with multiple files, often from the file
system, and with configuration files and ignore files.
When should I use this?
You typically use something that wraps this, such as:
unified-args— create CLIsunified-engine-gulp— create Gulp pluginsunified-language-server— create language servers
You can use this to make such things.
Compatibility
| Item | Value |
|---|---|
| Package | @stackline/unified-engine@1.0.2 |
| Supported Node.js | `^20.19.0 |
| Module entry | index.js (ES modules) |
| Runtime dependencies | 22 direct dependencies |
| Types | index.d.ts |
This fork supports Node.js 20.19+ on the 20.x line, and Node.js 22.12+. The callback API and unified 10 / vfile 5 type model are preserved.
Installation
npm install @stackline/unified-engine
This package is ESM only. In Node.js (20.19+ on the 20.x line, or 22.12+), install with npm:
npm install @stackline/unified-engine
Usage
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.
/**
* @typedef {import('unified-engine').Callback} Callback
*/
import {engine} from '@stackline/unified-engine'
import {remark} from 'remark'
engine(
{
processor: remark,
files: ['.'],
extensions: ['md', 'markdown', 'mkd', 'mkdn', 'mkdown'],
pluginPrefix: 'remark',
rcName: '.remarkrc',
packageField: 'remarkConfig',
ignoreName: '.remarkignore',
color: true
},
done
)
/** @type {Callback} */
function done(error) {
if (error) throw error
}
Security
Plugins and JavaScript configuration can execute code. Review the existing security guidance before processing an untrusted project.
unified-engine loads and evaluates configuration files, plugins, and presets
from the file system (often from node_modules/).
That means code that is on your file system runs.
Make sure you trust the workspace where you run unified-engine and be careful
with packages from npm and changes made by contributors.
API Surface
This package exports the identifier engine.
There is no default export.
engine(options, callback)
Process files according to options and call callback when
done.
options
processor(Processor) — unified processor to transform filescwd(stringorURL, default:process.cwd()) — directory to search files in, load plugins from, and morefiles(Array<string|URL|VFile>, optional) — paths or globs to files and directories, virtual files, or URLs, to processextensions(Array<string>, optional) — iffilesmatches directories, include files withextensionsstreamIn(ReadableStream, default:process.stdin) — stream to read from if no files are found or givenfilePath(string, optional) — file path to process the given file onstreamInasstreamOut(WritableStream, default:process.stdout) — stream to write processed files tostreamError(WritableStream, default:process.stderr) — stream to write the report (if any) toout(boolean, default: depends) — whether to write the processed file tostreamOutoutput(booleanorstring, default:false) — whether to write successfully processed files, and where toalwaysStringify(boolean, default:false) — whether to always serialize successfully processed filestree(boolean, default:false) — whether to treat both input and output as a syntax treetreeIn(boolean, default:tree) — whether to treat input as a syntax treetreeOut(boolean, default:tree) — whether to treat output as a syntax treeinspect(boolean, default:false) — whether to output a formatted syntax treercName(string, optional) — name of configuration files to loadpackageField(string, optional) — property at which configuration can be found inpackage.jsonfilesdetectConfig(boolean, default: whetherrcNameorpackageFieldis given) — whether to search for configuration filesrcPath(string, optional) — filepath to a configuration file to loadsettings(Object, optional) — configuration for the parser and compiler of the processorignoreName(string, optional) — name of ignore files to loaddetectIgnore(boolean, default: whetherignoreNameis given) — whether to search for ignore filesignorePath(string, optional) — filepath to an ignore file to loadignorePathResolveFrom('dir'or'cwd', default:'dir') — resolve patterns inignorePathfrom the current working directory or the file’s directoryignorePatterns(Array<string>, optional) — patterns to ignore in addition to ignore files, if anyignoreUnconfigured(boolean, default:false) — ignore files that do not have an associated detected configuration filesilentlyIgnore(boolean, default:false) — skip given files if they are ignoredplugins(Array|Object, optional) — plugins to usepluginPrefix(string, optional) — optional prefix to use when searching for pluginsconfigTransform(Function, optional) — transform config files from a different schemareporter(stringorfunction, default:import {reporter} from 'vfile-reporter') — reporter to usereporterOptions(Object?, optional) — config to pass to the used reportercolor(boolean, default:false) — whether to report with ANSI color sequencessilent(boolean, default:false) — report only fatal errorsquiet(boolean, default:silent) — do not report successful filesfrail(boolean, default:false) — call back with an unsuccessful (1) code on warnings as well as errors
function callback(error[, code, context])
Called when processing is complete, either with a fatal error if processing went horribly wrong (probably due to incorrect configuration on your part as a developer), or a status code and the processing context.
Parameters
error(Error) — fatal errorcode(number) — either0if successful, or1if unsuccessful, the latter occurs if fatal errors happen when processing individual files, or iffrailis set and warnings occurcontext(Object) — processing context, containing internally used information and afilesarray with the processed files
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.
Types
This package is fully typed with TypeScript. It additionally exports the following types:
VFileReporterOptions— models options passed to vfile reportersVFileReporter— models the signature accepted as a vfile reporterFileSet— models what is passed to plugins as a second parameterCompleter— models file set pluginsResolveFrom— models the enum allowed foroptions.ignorePathResolveFromConfigTransform— models the signature ofoptions.configTransformPreset— models a preset, likePresetfromunifiedbut accepts stringsOptions— models configurationContext— models the third parameter tocallbackCallback— models the signature ofcallback
Local Development
Clone the repository and run the following commands from its root:
npm ci
npm run build
npm test
npm run lint
npm run test:types
The retained upstream development notes below include historical tooling; the commands above are the maintained package checks.
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.
Release Checklist
- Update the package version, lockfile, generated version fields, and changelog together.
- Run the development checks above and audit both
npm auditandnpm audit --omit=dev. - Use the GitHub publish workflow with its
Prodenvironment to publish the exact CI tarball. - Verify public npm bytes, package identity, provenance, and the immutable GitHub release evidence.
Community and Support
Report reproducible package issues in the issue tracker.
License
MIT. Original copyright notices and upstream attribution are retained.
See NOTICE for retained attribution.
Release changes
Changelog
1.0.2 - 2026-09-28
- Replace stale direct runtime and development dependencies with verified Stackline maintenance forks, preserving existing import names and compatibility tests.
1.0.1 (2026-09-28)
- Standardize package documentation, preserve the API reference and upstream attribution, and add Stackline community links.
- Add focused npm discovery keywords and consistent repository metadata.
- Keep runtime behavior and dependency versions unchanged.
- Correct the pinned artifact-upload action commit while preserving the publish.yml workflow and Prod environment.
1.0.0
- Fork unified-engine 10.1.0 under @stackline with its MIT license, callback API and unified 10 / vfile 5 type model.
- Replace glob 8 with glob 13 and bridge the Promise result into the existing callback flow; explicitly preserve brace expansion detection.
- Use @stackline/load-plugin to remove deprecated glob dependencies from plugin resolution.
- Preserve exact public declaration files from the verified upstream npm release; validate consumer types with current TypeScript.
- Add brace, extglob, multi-pattern, unmatched, directory, ignore and single-file regression coverage; retain upstream integration suites.
Release files and references
Package bytes, npm provenance and the immutable GitHub release were verified for this version. Security checks describe the reviewed release; documented compatibility risks and upstream reports are not blanket claims of resolution.