Socket
Book a DemoInstallSign in
Socket

metarpheus

Package Overview
Dependencies
Maintainers
7
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metarpheus

A JS API for [`metarpheus`](https://github.com/buildo/metarpheus).

latest
npmnpm
Version
2.1.0
Version published
Weekly downloads
164
15.49%
Maintainers
7
Weekly downloads
 
Created
Source

metarpheus

A JS API for metarpheus.

It exposes a single function:

  • run(paths: string[], config?: Config): API

where:

  • paths is a list of absolute paths to analyze (they can be files or directories)
  • config [optional] is a configuration with the following (optional) keys:
    • modelsForciblyInUse: a list of models that are included even if unused by the exposed API.
    • discardRouteErrorModels (default false): set to true to discard models that are only used for route error types

and API is an object composed by two fields:

  • models: a list of models exposed by the API (or forcibly included, see above)
  • routes: a description of the HTTP routes available

Example:

const { run } = require('metarpheus');

const paths = [
  '/Users/example/buildo/project/api/src/main/scala'
];

const config = {
  modelsForciblyInUse: ['Swan']
};

const { models, routes } = run(paths, config);

console.log(JSON.stringify(models, null, 2), JSON.stringify(routes, null, 2));

FAQs

Package last updated on 21 Feb 2020

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