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

typeorm / typeorm / 19549987525

20 Nov 2025 08:11PM UTC coverage: 80.769% (+4.3%) from 76.433%
19549987525

push

github

web-flow
ci: run tests on commits to master and next (#11783)

Co-authored-by: Oleg "OSA413" Sokolov <OSA413@users.noreply.github.com>

26500 of 32174 branches covered (82.36%)

Branch coverage included in aggregate %.

91252 of 113615 relevant lines covered (80.32%)

88980.79 hits per line

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

22.73
/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 = await VersionCommand.executeCommand(
×
13
            "npm list --depth=0",
×
14
        )
×
15
        const localMatches = localNpmList.match(/ typeorm@(.*)\n/)
×
16
        const localNpmVersion = (
×
17
            localMatches && localMatches[1] ? localMatches[1] : ""
×
18
        )
×
19
            .replace(/"invalid"/gi, "")
×
20
            .trim()
×
21

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

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

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

208✔
55
    protected static executeCommand(command: string) {
208✔
56
        return new Promise<string>((ok, fail) => {
×
57
            exec(command, (error: any, stdout: any, stderr: any) => {
×
58
                if (stdout) return ok(stdout)
×
59
                if (stderr) return ok(stderr)
×
60
                if (error) return fail(error)
×
61
                ok("")
×
62
            })
×
63
        })
×
64
    }
×
65
}
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