🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

fib-swagger

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

fib-swagger

Swagger to fibjs Codegen

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Swagger to fibjs Codegen

This package generates a fibjs class from a swagger specification file. The code is generated using mustache templates and is quality checked by jshint and beautified by js-beautify.

The generator is based on superagent and can be used for fibjs.

This fork was made to simplify some parts, add some more features, and tailor it more to specific use cases.

Installation

fibjs --install fib-swagger

cli

fibjs node_modules/fib-swagger/lib/cli -c Test gen test.json test.js

Example Code

var fs = require("fs");
var CodeGen = require("fib-swagger").CodeGen;

var file = "swagger/spec.json";
var swagger = JSON.parse(fs.readFileSync(file, "UTF-8"));
var tsSourceCode = CodeGen.getFibjsCode({
  className: "Test",
  swagger: swagger
});
console.log(tsSourceCode);

FAQs

Package last updated on 20 Apr 2021

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