db-migrate-plugin-ts

    0.0.1 • Public • Published

    Plugin-Typescript

    A TypeScript plugin for db-migrate.

    Usage

    Usage is very simple. Simply install this plugin via npm install db-migrate-plugin-typescript or if using yarn: yarn add db-migrate-plugin-typescript

    This plugin has a peer dependency on ts-node as well. So you will need to install that as a dependency or dev-dependency as well, npm install ts-node or yarn add ts-node if using yarn.

    The plugin will automatically resolve and compile any .ts files in your migrations directory, using your regular tsconfig.json

    Do however note that this has no effect on generating new migrations. Using db-migrate create FooMigrations.ts will not create a TypeScript migration file.

    Implementation Detail

    The plugin hooks into the functionality of db-migrate itself. In this case it hooks into migrator:migration:hook:require, which in this case requires another transpiler (TypeScript) and registers also a new file extension (.ts). Make sure to name your migrations accordingly (ending with .ts).

    Install

    npm i db-migrate-plugin-ts

    DownloadsWeekly Downloads

    13

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    4.32 kB

    Total Files

    6

    Last publish

    Collaborators

    • erona