import { Env } from "./Env"; export class Service { public constructor(public env: Env) {} public static async from( this: T, directory: string, ): Promise> { const env = await Env.from(directory); if (!env) throw new Error( "Couldn't generate service. Something is wrong with your .env file, or one isn't present.", ); return new this(env) as InstanceType; } }