@frctl/fractal-plugin-files-parse-config
v0.1.0
Published
A Fractal plugin to parse the contents of config files.
Downloads
4
Keywords
Readme
Config file parser plugin
A Fractal parser plugin to read the contents of config files.
Provides (optional) adapters for YAML, JSON and CommonJS modules (with the ability to define custom ones as required).
This plugin is for use with the work-in-progress Fractal v2 release and will not work with earlier versions.
Overview
This plugin parses the contents of config files objects for which an adapter has been provided. Default behaviour is attempt to match any file with a role
property set to config
, but a custom filter filter can be specified instead if required.
Sets the parsed
property on matching file objects.
// before:
[{
path: 'path/to/config.yaml',
role: 'config',
contents: /* <Buffer> */,
// ...
}]
// after:
[{
path: 'path/to/config.yaml',
contents: /* <Buffer> */,
role: 'config',
parsed: {
// parsed data object contents
},
// ...
}]
Usage
This plugin is a core dependency of Fractal and does not need to be installed separately.
Requirements
@frctl/fractal-plugin-files-parse-config
requires Node >= v6.0