Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

focus-service-generator

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

focus-service-generator

File generation based on Swagger Interface

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

focus-service-generator

Node package to generate code from a swagger interface

How to use

  • Install as devDependencies npm i --save-dev focus-service-generator
  • Add a script line in your package json : "service-generator": "better-npm-run service-generator"
  • add a betterScript element in your package json
 "service-generator": {
           "command": "focus-service-generator",
           "env": {
               "TEMPLATE_FOLDER": "./node_modules/focus-service-generator/templates",
               "DEST_FOLDER": "./app/config/server/generated",
               "SWAGGER_SOURCE": "http://host/swagger/ur",
               "EOL": "\r\n"
           }
       },

Environment variables

  • TEMPLATE_FOLDER (default './node_modules/focus-service-generator/templates'): Folder containing templates .dot, see http://olado.github.io/doT/
  • DEST_FOLDER (default './app/config/server/generated'): Destination folder for generated files
  • SWAGGER_SOURCE (required): JSON of Swagger, either in file ('file:./my/swagger/file.json') or by HTTP request (http://host/swagger/url)
  • EOL (default '\n'): End of line in generated files

Customising

If the default templates does not suit your needs, just change the template folder, and create your own.

The first line of the render of a template must be the filepath.

FAQs

Package last updated on 18 Sep 2017

Did you know?

Socket

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.

Install

Related posts