forked from mulesoft-labs/raml-javascript-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathraml-javascript-generator.js
More file actions
25 lines (24 loc) · 1.22 KB
/
raml-javascript-generator.js
File metadata and controls
25 lines (24 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var path = require('path')
var fs = require('fs')
var generator = require('raml-generator')
module.exports = generator({
templates: {
'.gitignore': fs.readFileSync(path.join(__dirname, 'lib/templates/.gitignore.hbs'), 'utf8'),
'index.js': fs.readFileSync(path.join(__dirname, 'lib/templates/index.js.hbs'), 'utf8'),
'README.md': fs.readFileSync(path.join(__dirname, 'lib/templates/README.md.hbs'), 'utf8'),
'INSTALL.md': fs.readFileSync(path.join(__dirname, 'lib/templates/INSTALL.md.hbs'), 'utf8'),
'package.json': fs.readFileSync(path.join(__dirname, 'lib/templates/package.json.hbs'), 'utf8')
},
partials: {
auth: fs.readFileSync(path.join(__dirname, 'lib/partials/auth.js.hbs'), 'utf8'),
utils: fs.readFileSync(path.join(__dirname, 'lib/partials/utils.js.hbs'), 'utf8'),
client: fs.readFileSync(path.join(__dirname, 'lib/partials/client.js.hbs'), 'utf8'),
resources: fs.readFileSync(path.join(__dirname, 'lib/partials/resources.js.hbs'), 'utf8')
},
helpers: {
stringify: require('javascript-stringify'),
dependencies: require('./lib/helpers/dependencies'),
requestSnippet: require('./lib/helpers/request-snippet'),
parametersSnippet: require('./lib/helpers/parameters-snippet')
}
})