https://github.com/topherzee/gulp-json-to-yaml
A Gulp plugin to convert YAML to JSON
https://github.com/topherzee/gulp-json-to-yaml
Last synced: 4 months ago
JSON representation
A Gulp plugin to convert YAML to JSON
- Host: GitHub
- URL: https://github.com/topherzee/gulp-json-to-yaml
- Owner: topherzee
- License: mit
- Fork: true (crissdev/gulp-yaml)
- Created: 2015-12-01T10:47:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-25T21:33:53.000Z (over 9 years ago)
- Last Synced: 2025-01-16T16:21:31.517Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 31.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#[gulp](https://github.com/gulpjs/gulp)-json-to-yaml
> A [Gulp](https://github.com/gulpjs/gulp) plugin to convert [JSON](http://en.wikipedia.org/wiki/JSON) to[YAML](http://en.wikipedia.org/wiki/YAML) using [js-yaml](https://github.com/nodeca/js-yaml).
## Install
```sh
npm install --save-dev gulp-json-to-yaml
```## Usage
```js
var jsonToYaml = require('gulp-json-to-yaml');gulp.src('./src/*.json')
.pipe(jsonToYaml())
.pipe(gulp.dest('./dist/'))gulp.src('./src/*.json')
.pipe(jsonToYaml({ safe: true}))
.pipe(gulp.dest('./dist/'))```
## API
### jsonToYaml([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 [safeDump] method is used, otherwise [dump].
The options object is passed on to js-yaml methods.
See [js-yaml for details](https://github.com/nodeca/js-yaml)#### options.filename
Type `String`
Default: the path of the file processed
String to be used as a file path in error/warning messages.
## License
MIT