package
A Babel macro for loading YAML files
npm install yaml.macroGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
A Babel macro for loading YAML files.
npm install --save-dev yaml.macroSource:
# file.yaml
- YAML file
- with: some contentsimport yaml from 'yaml.macro'
const foo = yaml('./file.yaml')Result:
const foo = ['YAML file', { with: 'some contents' }];yaml(path: string, options?: {}): anyRelative path values should start with .. Internally, the macro uses yaml and supports its parser options as a second argument. As the macro arguments are evaluated at build time, they should not be dynamically modified by preceding code.
Multiple calls to load the same YAML file will not be cached.
Estimated unpacked size across 16 packages.
4.6 MB
Includes dependencies.
3 direct · 1 outdated