New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

generator-swaggerize

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-swaggerize - npm Package Compare versions

Comparing version 1.0.0-rc.2 to 1.0.0-rc.3

33

app/index.js

@@ -24,3 +24,3 @@ 'use strict';

askFor: function () {
var self, done;
var self, done, pkg;

@@ -30,2 +30,4 @@ self = this;

this.only = this.options.only;
this.framework = this.options.framework;
this.apiPath = this.options.apiPath && path.resolve(this.options.apiPath);
this.appname = path.basename(process.cwd());

@@ -40,2 +42,11 @@

if (this.only.length > 0) {
if (fs.existsSync(path.resolve('package.json'))) {
pkg = yeoman.file.readJSON(path.resolve('package.json'));
if (pkg.dependencies.hapi) {
this.framework = 'hapi';
}
}
}
function all() {

@@ -72,3 +83,4 @@ return self.only.length === 0;

message: 'Path (or URL) to swagger document:',
required: true
required: true,
default: this.apiPath
},

@@ -78,4 +90,3 @@ {

message: 'Express or Hapi:',
default: 'express',
when: all
default: this.framework || 'express',
}

@@ -85,3 +96,3 @@ ];

this.prompt(prompts, function (props) {
var self, pkg;
var self;

@@ -94,15 +105,5 @@ self = this;

this.email = props.email;
this.framework = props.framework || 'express';
this.framework = props.framework && props.framework.toLowerCase() || 'express';
this.appRoot = path.basename(process.cwd()) === this.appname ? this.destinationRoot() : path.join(this.destinationRoot(), this.appname);
if (this.only.length > 0) {
if (fs.existsSync(path.join(this.appRoot, 'package.json'))) {
pkg = yeoman.file.readJSON(path.join(this.appRoot, 'package.json'));
if (pkg.dependencies.hapi) {
this.framework = 'hapi';
}
}
}
if (this.framework !== 'express' && this.framework !== 'hapi') {

@@ -109,0 +110,0 @@ done(new Error('Unrecognized framework: ' + this.framework));

@@ -17,3 +17,3 @@ 'use strict';

app.use(swaggerize({
api: require('<%=apiPath%>'),
api: require('./<%=apiPath%>'),
handlers: path.join(__dirname, '<%=handlers%>')

@@ -20,0 +20,0 @@ }));

@@ -20,3 +20,3 @@ 'use strict';

options: {
api: require('<%=apiPath%>'),
api: require('./<%=apiPath%>'),
handlers: Path.join(__dirname, '<%=handlers%>')

@@ -23,0 +23,0 @@ }

@@ -19,3 +19,3 @@ 'use strict';

app.use(swaggerize({
api: require('<%=apiPath%>'),
api: require('./<%=apiPath%>'),
handlers: './handlers'

@@ -22,0 +22,0 @@ }));

{
"name": "generator-swaggerize",
"description": "Yeoman generator for swagger application with krakenjs/swaggerize tools.",
"version": "1.0.0-rc.2",
"version": "1.0.0-rc.3",
"author": "Trevor Livingston <tlivings@gmail.com>",

@@ -6,0 +6,0 @@ "keywords": [

@@ -42,1 +42,6 @@ [![Build Status](https://travis-ci.org/krakenjs/generator-swaggerize.png)](https://travis-ci.org/krakenjs/generator-swaggerize) [![NPM version](https://badge.fury.io/js/generator-swaggerize.png)](http://badge.fury.io/js/generator-swaggerize)

```
### Other CLI Options
- `--framework` - specify the framework (`hapi` or `express`).
- `--apiPath` - specify the path to the swagger document.
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