Flatten a multi-file RAML document into a single RAML file
CoffeeScript RAML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.gitignore
Cakefile
LICENSE
README.md
package.json

README.md

node-flat-raml

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