MCPcopy Index your code
hub / github.com/nodejs/node / viewMan

Method viewMan

deps/npm/lib/commands/help.js:82–103  ·  view source on GitHub ↗
(man)

Source from the content-addressed store, hash-verified

80 }
81
82 async viewMan (man) {
83 const viewer = this.npm.config.get('viewer')
84
85 if (viewer === 'browser') {
86 return openUrl(this.npm, this.htmlMan(man), 'help available at the following URL', true)
87 }
88
89 let args = ['man', [man]]
90 if (viewer === 'woman') {
91 args = ['emacsclient', ['-e', `(woman-find-file '${man}')`]]
92 }
93
94 try {
95 await input.start(() => spawn(...args, { stdio: 'inherit' }))
96 } catch (err) {
97 if (err.code) {
98 throw new Error(`help process exited with code: ${err.code}`)
99 } else {
100 throw err
101 }
102 }
103 }
104
105 // Returns the path to the html version of the man page
106 htmlMan (man) {

Callers 1

execMethod · 0.95

Calls 5

htmlManMethod · 0.95
getMethod · 0.65
openUrlFunction · 0.50
spawnFunction · 0.50
startMethod · 0.45

Tested by

no test coverage detected