PDPA Features: ✅ Cookie consent banner ✅ Consent logging API ✅ Admin dashboard ✅ Privacy Policy ✅ Terms & Conditions Technical: ✅ Astro 5.x + Tailwind v4 ✅ Docker on port 80 ✅ SQLite database ✅ 15 pages built Ready for Easypanel deployment.
19 lines
467 B
JavaScript
19 lines
467 B
JavaScript
'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('/')
|
|
const name = pmSpec.substring(0, separatorPos)
|
|
return {
|
|
name: name === 'npminstall' ? 'cnpm' : name,
|
|
version: pmSpec.substring(separatorPos + 1)
|
|
}
|
|
}
|