3 ms·
classes have the # prefix for private members and TS has the private keyword. If you don’t want to go with classes, not exporting a value or a function from a
by gherkinnn 3y ago
classes have the # prefix for private members and TS has the private keyword.
If you don’t want to go with classes, not exporting a value or a function from a module is almost the same. The rest can be done with closures.
- ec109685 3y agoIs there a “canonical” example of a module that is written well and uses what most would consider best practices? When looking through npm modules, there still seems to be a variety of approaches.
- gherkinnn 3y agoCanonical? Best practices? Not that I’m aware of. Not in Node. Deno has some ideas though: > Don’t import any symbol with an underscore prefix: export function _baz() {}. > Don’t link to / import any module whose path […] Has a name or parent with an underscore prefix: _foo.ts, _util/bar.ts. https://deno.land/std@0.204.0 https://deno.land/std@0.204.0