-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Due to yargs passing spawn: false to os-locale most of the functionality of that module is unused. The following could be used as a drop-in replacement for os-locale:
function osLocale() {
const locale = env.LC_ALL || env.LC_MESSAGES || env.LANG || env.LANGUAGE || 'en_US';
return locale.replace(/[.:].*/, '');
}The benefit is a large drop of production dependencies. Currently a project with yargs as the only dependency installs 53 modules / 1.8MB to node_modules. Without os-locale this becomes 26 modules / 1.1MB. The size reduction is not my primary interest of this issue, the goal is cutting the number of modules that have to be audited in half.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels