@apielements/apib-serializer
v0.16.3
Published
API Blueprint serializer for API Elements
Downloads
1,649
Readme
API Elements: API Blueprint Serializer
This adapter provides support for serializing API Blueprint in Fury.js from refract elements.
Install
$ npm install @apielements/apib-serializer
Usage
Async
import fury from 'fury';
import apibSerializer from '@apielements/apib-serializer';
fury.use(apibSerializer);
// Assume `api` is a Minim element instance, e.g. from `fury.parse(...)`
fury.serialize({ api }, (err, content) => {
fs.write('serialized.apib', content, 'utf8');
});
Sync
import fury from 'fury';
import apibSerializer from '@apielements/apib-serializer';
fury.use(apibSerializer);
try {
// Assume `api` is a Minim element instance, e.g. from `fury.parse(...)`
const content = fury.serializeSync({ api });
fs.write('serialized.apib', content, 'utf8');
} catch (error) {
console.log(error);
}