Kind: global class
- Document
- new Document(parsedJSONList, [base])
- .json() ⇒
Object
- .yml() ⇒
string
- .string() ⇒
string
Param | Type |
---|---|
parsedJSONList | Array.<Object> |
[base] | Object |
Example
const document = new Document(parsedJSONList, base);
console.log(document.json()); // get json object
console.log(document.yml()); // get yaml string
console.log(document.string()); // get json string
Kind: instance method of Document
Kind: instance method of Document
Kind: instance method of Document
bundle(files, options) ⇒ Document
Kind: global function
Param | Type | Description |
---|---|---|
files | Array.<string> | Array.<Object> |
files that are to be bundled |
options | Object |
|
options.base | string | object |
base object whose prperties will be retained. |
options.parser | Object |
asyncapi parser object |
options.validate | boolean |
pass false to not validate file before merge |
Example
const bundler = requrie('@asyncapi/bundler');
const fs = require('fs');
const path = requrie('path');
const document = await bundler.bundle(fs.readFileSync(
path.resolve('./asyncapi.yaml', 'utf-8')
));
console.log(document.yml());