gulp-yaml2properties v0.1.1
#gulp-yaml2properties
A Gulp plugin to convert YAML to .properties using js-yaml.
Install
npm install --save-dev gulp-yaml2properties
Usage
var yaml2properties = require('gulp-yaml2properties');
gulp.src('./src/*.yml')
.pipe(yaml2properties({ schema: 'DEFAULT_SAFE_SCHEMA' }))
.pipe(gulp.dest('./dist/'))
gulp.src('./src/*.yml')
.pipe(yaml2properties({ safe: true }))
.pipe(gulp.dest('./dist/'))
API
yaml2properties(options)
options.safe
Type: Boolean
Default: true
Enable or disable support for regexps, functions and undefined.
This flag should always be enabled when working with untrusted data.
When this flag is enabled then safeLoad method is used, otherwise load.
options.schema
Type: String
Default: DEFAULT_SAFE_SCHEMA
or DEFAULT_FULL_SCHEMA
Specifies what schema to use. Valid values are the same that js-yaml supports, except they are received as strings (lowercase or uppercase). See the example in the Usage section of this README. The default schema is chosen using the safe
option.
options.filename
Type String
Default: the path of the file processed
String to be used as a file path in error/warning messages.
Credits
- gulp-yaml served as the foundation and starting point for this package – I just had to tweak it a little bit to output
.properties
instead of.json
files. So, all kudos belong to Cristian Trifan. Mulţumesc!
License
View the LICENSE file (MIT).