map.on('zoomend', function() { /* ... */ })
Inside it, you will need to adjust the width of you polyline (or path object in general), so
polyline.setStyle({weight: your_weight })
Now, the real problem comes with the meters. Im not sure how to solve this automatically, but the easierst way would be to simple have an array in the form of (zoomlevel -> line width), because zoom levels are integers. So you would only have to set this array up once (and just test what line width looks good) and use this array inside the zoomend handler so dynamically change the line width.
There might be a way for converting meter -> line width, but that might be pretty complicated i think (because of custom projections and stuff), while this is basically a "test once all relevant zoom levels and you are set" solution. Changing the linewidth in the dev console of your browser is easy, so this should be a pretty fast solution for your use case (i know it doesnt exactly solve the asked question, but maybe your problem)
Max