Closed
Description
Partially implemented by #1474
Motivation: to support ts-node-esm
, plus improve the API in general.
Should be able to read configuration without creating a Service
nor loading any extra dependencies.
While we're at it, we should allow create()
ing a service and then passing it to register()
. Should not be forced to create and register at once.
import * as tsNode from 'ts-node';
// Not to be confused with current, internal readConfig, which is narrower in scope
const config = tsNode.readConfig(/*ReadConfigOptions, similar to CreateOptions*/);
const service = createFromConfig(config);
register(service); // Can we do this with overload? Do we need new `registerService()` function?
Will allow ts-node-esm
to read config, determine it needs to spawn child process, spawn child, and then for child to skip the config parsing step and call create
and register
.
Metadata
Metadata
Assignees
Labels
No labels