Gathering detailed insights and metrics for @unifiedts/engine
Gathering detailed insights and metrics for @unifiedts/engine
Gathering detailed insights and metrics for @unifiedts/engine
Gathering detailed insights and metrics for @unifiedts/engine
npm install @unifiedts/engine
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
221 Commits
2 Branches
1 Contributors
Updated on Mar 19, 2022
Latest Version
9.0.5
Package Id
@unifiedts/engine@9.0.5
Unpacked Size
102.62 kB
Size
25.22 kB
File Count
49
NPM Version
8.1.2
Node Version
16.13.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
23
Engine to process multiple files with unified, allowing users to configure from the file system.
The following projects wrap the engine:
unified-args
— Create CLIs for processorsunified-engine-gulp
— Create Gulp pluginsunified-engine-atom
— Create Atom Linters for processorsunified-language-server
— Create language servers for
processorsThis package is ESM only:
Node 12+ is needed to use it and it must be import
ed instead of require
d.
npm:
1npm install unified-engine
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.
1import {engine} from 'unified-engine' 2import {remark} from 'remark' 3 4engine( 5 { 6 processor: remark, 7 files: ['.'], 8 extensions: ['md', 'markdown', 'mkd', 'mkdn', 'mkdown'], 9 pluginPrefix: 'remark', 10 rcName: '.remarkrc', 11 packageField: 'remarkConfig', 12 ignoreName: '.remarkignore', 13 color: true 14 }, 15 done 16) 17 18function done(error) { 19 if (error) throw error 20}
This package exports the following identifiers: 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
(string
, default: process.cwd()
)
— Directory to search files in, load plugins from, and morefiles
(Array<string|VFile>
, optional)
— Paths or globs to files and directories, or virtual files, to processextensions
(Array<string>
, optional)
— If files
matches directories, include files with extensions
streamIn
(ReadableStream
, default: process.stdin
)
— Stream to read from if no files are found or givenfilePath
(string
, optional)
— File path to process the given file on streamIn
asstreamOut
(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 to streamOut
output
(boolean
or string
, 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 in package.json
filesdetectConfig
(boolean
, default: whether rcName
or
packageField
is 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: whether ignoreName
is given)
— Whether to search for ignore filesignorePath
(string
, optional)
— Filepath to an ignore file to loadignorePathResolveFrom
('dir'
or 'cwd'
,
default: 'dir'
)
— Resolve patterns in ignorePath
from the current working directory or the
file’s directoryignorePatterns
(Array<string>
, optional)
— Patterns to ignore in addition to ignore files, if anysilentlyIgnore
(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
(string
or function
, 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 errorsfunction callback(error[, code, context])
Called when processing is complete, either with a fatal error if processing went horribly wrong (probably due to incorrect configuration), or a status code and the processing context.
error
(Error
) — Fatal errorcode
(number
) — Either 0
if successful, or 1
if unsuccessful.
The latter occurs if fatal errors happen when processing individual
files, or if frail
is set and warnings occurcontext
(Object
) — Processing context, containing internally used
information and a files
array with the processed filesdoc/plugins.md
describes in detail how plugins can add more files
to be processed and handle all transformed files.
doc/configure.md
describes in detail how configuration files
work.
doc/ignore.md
describes in detail how ignore files work.
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.
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.
No vulnerabilities found.
No security vulnerabilities found.