Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 25 days 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 (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-03T13:38:12.000Z (almost 7 years ago)
- Last Synced: 2024-11-14T16:14:27.349Z (3 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
[![Build Status](https://travis-ci.org/oori/gulp-jsonschema-bundle.svg?branch=master)](https://travis-ci.org/oori/gulp-jsonschema-bundle)
[![Dependencies](https://david-dm.org/oori/gulp-jsonschema-bundle.svg)](https://david-dm.org/oori/gulp-jsonschema-bundle)
[![Inline docs](http://inch-ci.org/github/oori/gulp-jsonschema-bundle.svg?branch=master)](http://inch-ci.org/github/oori/gulp-jsonschema-bundle)
[![npm](http://img.shields.io/npm/v/gulp-jsonschema-bundle.svg)](https://www.npmjs.com/package/gulp-jsonschema-bundle)
[![License](https://img.shields.io/npm/l/gulp-jsonschema-bundle.svg)](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)