Performance: path.join for cross-platform paths
LOW IMPACT
This affects how file paths are constructed and interpreted across different operating systems, impacting script portability and runtime errors.
const path = require('path'); const filePath = path.join('folder', 'subfolder', 'file.txt');
const filePath = 'folder/' + 'subfolder/' + 'file.txt';
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Manual string concatenation for paths | 0 | 0 | 0 | [OK] Good for small scripts but risky cross-platform |
| Using path.join for paths | 0 | 0 | 0 | [OK] Best practice for cross-platform compatibility |