Files
shields/scripts/export-service-definitions-cli.js
Paul Melnikow be7cb93773 Refactor service loader (#2861)
This moves the loader code into `core/base-service`, leaving behind in `services/index.js` only the convenience imports.

Ref #2832
2019-01-24 22:55:10 -05:00

14 lines
369 B
JavaScript

'use strict'
const yaml = require('js-yaml')
const { collectDefinitions } = require('../core/base-service/loader')
const definitions = collectDefinitions()
// Omit undefined
// https://github.com/nodeca/js-yaml/issues/356#issuecomment-312430599
const cleaned = JSON.parse(JSON.stringify(definitions))
process.stdout.write(yaml.safeDump(cleaned, { flowLevel: 5 }))