https://github.com/oori/gulp-jsonschema-bundle
Gulp plugin to bundle external $ref references (file+http) into a single json schema
https://github.com/oori/gulp-jsonschema-bundle
gulp-plugins json-schema
Last synced: 4 months ago
JSON representation
Gulp plugin to bundle external $ref references (file+http) into a single json schema
- Host: GitHub
- URL: https://github.com/oori/gulp-jsonschema-bundle
- Owner: oori
- License: mit
- Created: 2016-06-09T01:44:47.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-03T13:38:12.000Z (about 7 years ago)
- Last Synced: 2025-01-14T12:25:07.685Z (6 months ago)
- Topics: gulp-plugins, json-schema
- Language: JavaScript
- Homepage:
- Size: 56.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# gulp-jsonschema-bundle
[](https://travis-ci.org/oori/gulp-jsonschema-bundle)
[](https://david-dm.org/oori/gulp-jsonschema-bundle)
[](http://inch-ci.org/github/oori/gulp-jsonschema-bundle)
[](https://www.npmjs.com/package/gulp-jsonschema-bundle)
[](LICENSE)> Gulp plugin to bundle external $ref references (*file+http*) into a single json schema
## Install
```
$ npm install --save-dev gulp-jsonschema-bundle
```## Usage
```js
var gulp = require('gulp');
var jsonschemaBundle = require('gulp-jsonschema-bundle');var schemaFiles = '*.schema.json',
definitionsFiles = 'definitions/' + schemaFiles,
buildFolder = 'build';gulp.task('resolve-schema', function() {
var stream = gulp.src( schemaFiles )
.pipe( jsonschemaBundle() )
.pipe( gulp.dest(buildFolder) );
return stream;
});gulp.task('watch-schema', function() {
var watcher = gulp.watch( [schemaFiles,definitionsFiles], ['resolve-schema']);watcher.on('change', function(event) {
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
});
});gulp.task('default', ['resolve-schema','watch-schema']);
```## API
Currently, dependant on [json-schema-ref-parser](https://github.com/BigstickCarpet/json-schema-ref-parser)### jsonschemaBundle([options])
#### options
see: [bundle](https://github.com/BigstickCarpet/json-schema-ref-parser/blob/master/docs/ref-parser.md#bundleschema-options-callback)
## License
MIT © [oori](https://github.com/oori)