Ideally, to be used with JS Array join and String replace methods, like so:
process.argv.join(' ').replace(/["']/g, '').match(/(?<=--path[ |=])dist\/.*(?=$)/);
The join is to convert array to string to prevent iterating. The replace is to remove single or double quotes for easier matching. The 'dist' folder is a safeguard to prevent matching anything outside of that folder.