NPM Install add custom warning message
There's not necessarily a way you can do that, or not with given fields like "deprecated"
What you can do, which is a little bit of a workaround, is adding a post-install script, that outputs a string to the console if you mark a version as alpha.
// package.json
{
"version": "1.2.3-alpha.2",
"scripts": {
"postinstall": "node postinstall.js"
}
}
// postinstall.js
const package = require('./package.json')
if (package.version.includes('alpha')) {
console.log('You are using an alpha version. Beware!')
}