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

predeploy-builder

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

predeploy-builder

a builder used to generate api at apiary and update client lib on npm

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

predeploy-builder

A builder used to generate an api at apiary/generate client lib and publish client lib to npm

##Requirements

1.Install swagger-codegen command line tools at https://github.com/swagger-api/swagger-codegen
2.npm install -g cli-codegen 
3.Easiest to run this code while app is running and swagger is at localhost:8000/swagger.json
4.Look at https://www.npmjs.com/package/cli-codegen if swagger location different.

##Example First:

npm install predeploy-builder

Next:

var builder = require('builder');

var config  = {
	client: { //required for .makeClientLib(),writePackage() and publish() 
		file: 'File name' //not required,
		classname: 'classname for javascript gen' //required for js
		language: 'language to generate lib for' //required
	}
	apiary : {
		token: 'your apiary account token' //required
		name: 'your apiary api name' //required,
		sub_domain: 'This is used to point readme to your proper api location in apiary' //required for writeReadme()
	}
	package: { //Anything not passed in will be pulled from project package file that was used to generate lib
		name: 'name that will go in package' //not required
		version: 'version that will go in package' //not required
		description: 'description that will go in package' //not required
		author: 'author that will go in package' //not required
		license: 'license that will go in package' //not required
	}
	port: 'port your api is hosted on' // will default to 8000 if not passed in
}	

var build = new builder(config);

###genDocs: Note: right now you can only push docs that are in .yaml format

build.genDocs( (err,result) => {} )

//This Method is used to publish api to apiary

###makeClientLib:

build.makeClientLib( (err,result => {} )

//This Method is used to generate client library for a language based on config from earlier.

###writePackage

build.writePackage( (err,result) => {} )

//this Method is used to write a package file in order to prep for npm publish

###writeReadme

build.writeReadme ( (err,result) => {} )

//This Method is used to write a readme.md pointing to apiary docs.	

###publish

build.publish( (err,result) => {} )

//This method is used to publish the newly made client lib to npm

###Note: makeClientLib(),writePackage() and publish() should all be used togeather. Only makeClientLib() can work on its own.

FAQs

Package last updated on 09 Mar 2016

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

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