Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Latest commit

 

History

History
36 lines (23 loc) · 933 Bytes

README.md

File metadata and controls

36 lines (23 loc) · 933 Bytes

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.

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));