tyfigo

nub

Preload tyfigo/register in nub.jsonc.

nub runs on Node's module hooks, so tyfigo's Node hook works as a preload:

nub.jsonc
{
	"preload": ["tyfigo/register"],
}
package.json
{
	"scripts": {
		"start": "nub src/main.ts",
		"typecheck": "tsc --noEmit --runExternalCode"
	}
}
src/main.ts
import config from '../config/app.config.yaml';

const bucketUrl = `s3://${config.storage.bucket}?region=${config.storage.region}`;

Everything else works as on Node. See the nub example.