Socket
Socket
Sign inDemoInstall

db-migrate-plugin-typescript

Package Overview
Dependencies
22
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    db-migrate-plugin-typescript

A db-migrate plugin to enable TypeScript style migrations.


Version published
Maintainers
2
Install size
4.29 kB
Created

Readme

Source

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).

Keywords

FAQs

Last updated on 07 Dec 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc