Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rjgf/swagger2ts

Package Overview
Dependencies
Maintainers
7
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rjgf/swagger2ts - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

30

bin/swagger.js

@@ -7,7 +7,21 @@ #!/usr/bin/env node --no-deprecation --abort-on-uncaught-exception --no-warnings

const axios = require('axios')
require('dotenv').config()
const { exec } = require('child_process')
const defaultOutputDir = path.join(process.cwd(), '.', 'src', 'api')
const defaultSwaggerFileName = 'swagger.ts'
readConfigFile()
async function main() {
procesesArgvs()
const config = await readConfigFile()
await generateSwagger(config)
postExeHook(config)
}
function procesesArgvs() {
if (process.argv.includes('--env-path')) {
const index = process.argv.findIndex(((v) => v === "--env-path"))
const path = process.argv[index + 1]
if (path) {
require('dotenv').config({ path })
}
}
}
async function readConfigFile() {

@@ -22,6 +36,6 @@ const jsonConfigPath = path.join(process.cwd(), 'swaggertsrc.json')

})
generateSwagger(configJson)
return configJson
} else if (hasJSConfigPath) {
const jsConfig = require(jsConfigPath)
generateSwagger(jsConfig)
return jsConfig
} else {

@@ -80,1 +94,9 @@ throw Error('swaggertsrc.json not found Please create swaggertsrc.json or .swaggertsrc.js in the root directory')

}
function postExeHook(config) {
if (config.postexe) {
console.log(`postexe: ${config.postexe}`)
exec(config.postexe)
}
}
main()

2

package.json

@@ -23,3 +23,3 @@ {

},
"version": "1.1.0",
"version": "1.2.0",
"dependencies": {

@@ -26,0 +26,0 @@ "dotenv": "^16.0.3"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc