3 ms·
The weakest spots in the JS code I have seen, in npm and the projects I've had to maintain: - Profiling CPU and memory: preventing and mitigating resource leak
by partycoder 10y ago
The weakest spots in the JS code I have seen, in npm and the projects I've had to maintain:
- Profiling CPU and memory: preventing and mitigating resource leaks.
- Robustness: Input validation, error handling, logging.
- Event handling and construction of finite state machines: defining states and transitions and validating them.
- Using a sane coding standard. Like Google's JS standard rather than the self proclaimed "standard" from feross.
The "request" npm module for example, is a FSM where states are defined by a combination of flags. However you can obtain states that are not handled by the library, because the FSM is constructed poorly without validating state transitions. That is a very common theme in npm modules.