js-yaml-type-data
v1.0.1
Published
Custom type for js-yaml to include other files via data URI scheme
Downloads
11
Readme
js-yaml-type-data
Use it like this:
import createDataType from 'js-yaml-type-data'
const type = createDataType({
relativeTo: './path', // is optional and defaults to the current directory
})
const schema = new yaml.Schema({
include: [yaml.DEFAULT_SAFE_SCHEMA],
explicit: [type],
})
const parsed = yaml.load(`
includedPNG: !!data "file.png"
`, { schema })