If you’re using the new native Node.js runtime, then you can refer to this solution.
If you’re using the old Forge runtime, then you can look into setting environment variables as an alternative (don’t know if there’s a better way to achieve this).
E.g.
forge variables set --environment production ENVIRONMENT PRODUCTION
forge variables set --environment staging ENVIRONMENT STAGING
forge variables set --environment development ENVIRONMENT DEVELOPMENT