Create a new TypeScript compiler instance and register it onto node.js
Register TypeScript compiler instance onto node.js
Create a ts-node REPL instance.
Pay close attention to the example below. Today, the API requires a few lines
of boilerplate to correctly bind the ReplService
to the ts-node Service
and
vice-versa.
Usage example:
const repl = tsNode.createRepl();
const service = tsNode.create({...repl.evalAwarePartialHost});
repl.setService(service);
repl.start();
Called by ts-node to create a custom transpiler.
Create an implementation of node's ESM loader hooks.
This may be useful if you want to wrap or compose the loader hooks to add additional functionality or combine with another loader.
Node changed the hooks API, so there are two possible APIs. This function detects your node version and returns the appropriate API.
Filesystem host functions which are aware of the "virtual" [eval].ts
, <repl>
, or [stdin].ts
file used to compile REPL inputs.
Must be passed to create()
to create a ts-node compiler service which can compile REPL inputs.
When using module: nodenext
or module: node12
, there are two possible styles of emit depending in file extension or package.json "type":
require()
calls)import foo = require()
transformed into require = createRequire(); const foo = require()
Re-export of Service
interface for backwards-compatibility
Registered ts-node
instance information.
Export the current version.
Generated using TypeDoc
Create TypeScript compiler instance.