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

@sheknows/swagger-js-client

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sheknows/swagger-js-client

SheKnows universal Swagger JS client

  • 2.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
18
decreased by-41.94%
Maintainers
2
Weekly downloads
 
Created
Source

SheKnows Universal Swagger JS Client

Description

SheKnows Universal Swagger JS Client.

Installation

# install dependencies
$ npm install

# build for production
$ npm run build

# run tests
npm test

Usage

import getClient from 'swagger-js-client'

getClient({
  host: 'HOST', // (or swaggerUrl)
  key: 'KEY',
  secret: 'SECRET'
})
  .then(client => client.apis['TAG_NAME']['METHOD_NAME'](params))
  .then(data => {
    console.log(data.body)
  })
  .catch(err => {
    console.error('Oops:', err)
  })

For more examples, please refer to the test directory.

Update client

Because this client is generated on-the-fly by dynamically consuming swagger.json, no client update (often referred to as "regeneration") is needed.

If you would like to update the client's code however:

  • npm run build
  • bump the version
    • npm version $version where $version is <newversion>, major, minor or patch (for more info see NPM docs)

After the code is merged to master, run npm publish.

:warning: Make sure all Tests are passing after updates.

FAQs

Package last updated on 27 Feb 2024

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