yargs / require-main-filename

shim for require.main.filename() that works in as many environments as possible
ISC License
18 stars 9 forks source link

process.cwd() vs __dirname #37

Open jean-emmanuel opened 5 years ago

jean-emmanuel commented 5 years ago

Is there a good reason to use process.cwd() over __dirname to find the main script's location ? See https://github.com/yargs/yargs/issues/1248 for details.

bcoe commented 5 years ago

@jean-emmanuel why I made this decision I think is somewhat lost to the annals of time; I'd vote that we make these settings programmatically configurable with yargsSettings (perhaps), and move away from this historic package.json based approach -- another argument for this, is perhaps we can make it a breaking change and remove the find-package-up dependency? I'm not sure, we might use this elsewhere in the codebase for our config management.