JsNik is node library for generating Mapnik configuration in JS. This adds all the benefits of scripting like preventing repetition, programatic style generation, etc.
npm install jsnik
Mapnik configuration in JS: https://github.com/FreemapSlovakia/freemap-mapnik/blob/master/app/style/index.js
Resulting map: https://www.freemap.sk/?map=10/48.725397/19.414215&layers=X