Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
raml-generator
Advanced tools
Generate files from a RAML document and Handlebars templates.
npm install raml-generator --save
The module accepts a map of Handlebars templates, partials and helpers, and exports a function that can be used to generate files from a RAML object and user data.
Create the generator function from an object specification. The returned object accepts two parameters, the RAML object and user package information.
var fs = require('fs')
var generator = require('raml-generator')
var generate = generator({
templates: {
'index.js': fs.readFileSync(__dirname + '/templates/index.js.hbs')
},
helpers: {
stringify: require('javascript-stringify')
}
}) //=> [Function]
Inside the Handlebars templates, the RAML interface is exposed as Handlebars data.
var baseUri = {{stringify @getBaseUri}}
The user data is automatically provided as the Handlebars compile context.
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
.
var bin = require('raml-generator/bin')
var generate = /* The generator function */
bin(generate, require('./package.json'), process.argv)
Apache License 2.0
FAQs
Generate files from a RAML document and template functions
The npm package raml-generator receives a total of 20 weekly downloads. As such, raml-generator popularity was classified as not popular.
We found that raml-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.