Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
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.
raml-generator
Advanced tools
Generate files from a RAML document and templates.
npm install raml-generator --save
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.
Create the generator function from config. The returned object accepts two arguments, the RAML object and user config.
var fs = require('fs')
var Handlebars = require('handlebars')
var generator = require('raml-generator')
module.exports = generator({
templates: {
'index.js': Handlebars.compile(fs.readFileSync(__dirname + '/templates/index.js.hbs', 'utf8'))
}
}) //=> [Function]
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 = require('raml-generator/bin')
var generator = /* The generator function */
bin(generator, require('./package.json'), process.argv)
Generated CLI:
generator --out [directory]
--data, -d Path to JSON configuration file
--include, -i Include additional RAML files (E.g. extensions)
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
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.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.