josephg / josephg/braid-protocol
Prefer not to use "export default"
- Dominant language
- TypeScript
- Stars
- 27
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
I'd prefer to use "export [name]" instead of "export default" and "module.exports =". The main reason is that our library can give reasonable naming expectations to users of this library, which improves the ecosystem's legibility.
For example, if `user A` says `import braid from "@josephg/braid-server` in their code, while `user B` says `import stream from "@josephg/braid-server"` this adds unnecessary confusion to newcomers looking across code bases that use our library.
As far as I know, there is very little downside to named exports--if a user is particularly opinionated and really wants to override our naming expections, they can always reach for `import { stream as braid } from "@josephg/braid-server` or `const braid = require("@josephg/braid-server").stream` if they want to.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.