You can use variables in your custom npm commands (example from https://www.twilio.com/blog/npm-scripts):
{ "scripts": { "demo": "echo \"Hello $npm_config_first $npm_config_last\"" } }
Ss it possible with yarn?