
Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
swagger-inline2
Advanced tools
Node module for extracting swagger endpoints from inline comments.
npm install --save-dev swagger-inline
npm run build # single build
npm start # build + watch
npm test # single run
npm run test-watch # test + watch
swaggerInline([inputGlobs...], options) => Promise => json | yaml
const swaggerInline = require('swagger-inline');
swaggerInline(['src/**/*.js', 'test/**/*.js'], {
base: 'swaggerBase.json',
}).then((generatedSwagger) => {
/* ... */
});
swagger-inline <inputGlobs ...> [--base] [--format]
swagger-inline 'src/**/*.js' --base 'swaggerBase.json' # outputs built swagger.json
Options:
inputGlobs
: Files/globs to search for swagger comments.base
: Base swagger.json
or swagger.yml
to build ontoformat
: Output filename - .json
or .yaml
(default: .json
)swaggerBase.yml
swagger: "2.0"
host: "petstore.swagger.io"
basePath: "/api"
schemes: ['http']
api.js
/*
* @api [get] /pets
* description: "Returns all pets from the system that the user has access to"
* responses:
* "200":
* description: "A list of pets."
* schema:
* type: "String"
*/
api.route('/pets', function() {
/* Pet code 😺 */
});
swagger-inline './*.js' --base './swaggerBase.yml'
Output:
swagger.yml
swagger: "2.0"
host: "petstore.swagger.io"
basePath: "/api"
schemes: ['http']
/pets:
get:
description: Returns all pets from the system that the user has access to
responses:
'200':
description: A list of pets.
schema:
type: "String"
FAQs
Generate your swagger files from inline swagger comments.
The npm package swagger-inline2 receives a total of 0 weekly downloads. As such, swagger-inline2 popularity was classified as not popular.
We found that swagger-inline2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.