Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Unless you are working in a single process script, barrel file is almost unavoidable. A typical nodejs app will often be split in many packages, requiring barrel file anyway.


After years of writing JS/TS apps, barrel files are absolutely avoidable. You just write your functions / classes / variables, and import them wherever needed. No intermediary step of re-exporting them is needed.


I've never really used barrel files, I don't see why they are unavoidable




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: