Repository URL to install this package:
|
Version:
1.1.0-1 ▾
|
vending-mp-tcn-dep
/
usr
/
local
/
lib
/
vending
/
mp
/
tcn
/
node_modules
/
which-pm-runs
/
index.js
|
|---|
'use strict'
module.exports = function () {
if (!process.env.npm_config_user_agent) {
return undefined
}
return pmFromUserAgent(process.env.npm_config_user_agent)
}
function pmFromUserAgent (userAgent) {
const pmSpec = userAgent.split(' ')[0]
const separatorPos = pmSpec.lastIndexOf('/')
return {
name: pmSpec.substr(0, separatorPos),
version: pmSpec.substr(separatorPos + 1)
}
}