
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
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', 'utf8')
},
helpers: {
stringify: require('javascript-stringify')
}
}) //=> [Function]
Inside the Handlebars templates, the RAML interface is exposed as Handlebars data.
var baseUri = {{stringify baseUri}}
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 7 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.