• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

typeorm / typeorm / 20153290793

12 Dec 2025 01:29AM UTC coverage: 80.807% (+0.04%) from 80.764%
20153290793

push

github

alumni
refactor(mysql)!: drop support for mysql package and default to mysql2 (#11766)

Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com>

26912 of 32666 branches covered (82.39%)

Branch coverage included in aggregate %.

13 of 15 new or added lines in 2 files covered. (86.67%)

694 existing lines in 23 files now uncovered.

91350 of 113685 relevant lines covered (80.35%)

68942.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

23.08
/src/commands/VersionCommand.ts
1
import * as yargs from "yargs"
26✔
2
import { exec } from "child_process"
26✔
3

26✔
4
/**
26✔
5
 * Shows typeorm version.
26✔
6
 */
26✔
7
export class VersionCommand implements yargs.CommandModule {
208✔
8
    command = "version"
208✔
9
    describe = "Prints TypeORM version this project uses."
208✔
10

208✔
11
    async handler() {
208✔
12
        const localNpmList =
×
13
            await VersionCommand.executeCommand("npm list --depth=0")
×
14
        const localMatches = localNpmList.match(/ typeorm@(.*)\n/)
×
15
        const localNpmVersion = (
×
16
            localMatches && localMatches[1] ? localMatches[1] : ""
×
17
        )
×
18
            .replace(/"invalid"/gi, "")
×
19
            .trim()
×
20

×
21
        const globalNpmList = await VersionCommand.executeCommand(
×
22
            "npm list -g --depth=0",
×
23
        )
×
24
        const globalMatches = globalNpmList.match(/ typeorm@(.*)\n/)
×
25
        const globalNpmVersion = (
×
26
            globalMatches && globalMatches[1] ? globalMatches[1] : ""
×
27
        )
×
28
            .replace(/"invalid"/gi, "")
×
29
            .trim()
×
30

×
31
        if (localNpmVersion) {
×
32
            console.log("Local installed version:", localNpmVersion)
×
33
        } else {
×
34
            console.log("No local installed TypeORM was found.")
×
35
        }
×
36
        if (globalNpmVersion) {
×
37
            console.log("Global installed TypeORM version:", globalNpmVersion)
×
38
        } else {
×
39
            console.log("No global installed was found.")
×
40
        }
×
41

×
42
        if (
×
43
            localNpmVersion &&
×
44
            globalNpmVersion &&
×
45
            localNpmVersion !== globalNpmVersion
×
46
        ) {
×
47
            console.log(
×
48
                "To avoid issues with CLI please make sure your global and local TypeORM versions match, " +
×
49
                    "or you are using locally installed TypeORM instead of global one.",
×
50
            )
×
51
        }
×
52
    }
×
53

208✔
54
    protected static executeCommand(command: string) {
208✔
UNCOV
55
        return new Promise<string>((ok, fail) => {
×
56
            exec(command, (error: any, stdout: any, stderr: any) => {
×
57
                if (stdout) return ok(stdout)
×
58
                if (stderr) return ok(stderr)
×
59
                if (error) return fail(error)
×
60
                ok("")
×
61
            })
×
62
        })
×
63
    }
×
64
}
208✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc