Skip to content

Instantly share code, notes, and snippets.

@jhfgloria
Last active August 2, 2023 21:22
Show Gist options
  • Select an option

  • Save jhfgloria/04be4d585fbc2b79ab1b627b5f057146 to your computer and use it in GitHub Desktop.

Select an option

Save jhfgloria/04be4d585fbc2b79ab1b627b5f057146 to your computer and use it in GitHub Desktop.
Running one-offs using NestJS
// one-off.ts
import { NestFactory } from '@nestjs/core';
import { OneOffModule } from './one-off.module';
async function oneOff() {
const application = await NestFactory.createApplicationContext(OneOffModule);
await application.close();
}
oneOff().catch(console.error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment