1 | #!/usr/bin/env node
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | const path = require('path')
|
7 | const Config = require('@npmcli/config')
|
8 | const { definitions, flatten, shorthands } = require('@npmcli/config/lib/definitions')
|
9 | const config = new Config({
|
10 | npmPath: path.dirname(__dirname),
|
11 |
|
12 | argv: [],
|
13 | definitions,
|
14 | flatten,
|
15 | shorthands,
|
16 | excludeNpmCwd: false,
|
17 | })
|
18 |
|
19 | async function main () {
|
20 | try {
|
21 | await config.load()
|
22 |
|
23 | console.log(config.globalPrefix)
|
24 | } catch (err) {
|
25 |
|
26 | console.error(err)
|
27 | process.exit(1)
|
28 | }
|
29 | }
|
30 | main()
|