Skip to content
This repository has been archived by the owner on Sep 18, 2019. It is now read-only.

Latest commit

 

History

History
22 lines (19 loc) · 746 Bytes

README.md

File metadata and controls

22 lines (19 loc) · 746 Bytes

node-flat-raml [⚠️ DEPRECATED ⚠️]

Flatten a multi-file RAML document into a single RAML file

Flattening a RAML document into a single file

srcFile = 'spec.raml'
dstFile = 'flat.raml'
flattener = require 'flat-raml' 
flattener.flatten srcFile dstFile
  .then (outFile) -> console.log(outFile, "written")
  .catch (error) -> "error flattening RAML doc:", error, "\nstack:\n", error.stack

Parsing a RAML document into a serialized string

srcFile = 'spec.raml'
flattener = require 'flat-raml' 
flattener.asString srcFile
  .then (serialized) -> console.log(srcFile, "read. Serialized content:\n", serialized)
  .catch (error) -> "error reading RAML doc:", error, "\nstack:\n", error.stack