RAML Generator
Generate files from a RAML document and templates.
Installation
npm install raml-generator --save
Usage
The module accepts a map of functions (usually compiled templates, such as Handlebars), and returns a function that will generate files given an instance of the RAML 1 parser JSON.
For an example module, take a look at the raml-javascript-generator.
Why use this? It's just a simple, high level API for creating generators with a standard API.
JavaScript Usage
Create the generator function from config. The returned object accepts two arguments, the RAML object and user config.
var fs = var Handlebars = var generator = moduleexports = //=> [Function]
Bin Script
A bin
script is provided for you to use with your custom generator. Just require raml-generator/bin
and pass in the generator function (from above), package information (package.json
) and process.argv
.
#!/usr/bin/env node var bin = var generator = /* The generator function */
Generated CLI:
generator --out [directory] --data, -d Path to JSON configuration file --include, -i Include additional RAML files
License
Apache License 2.0