Find the root directory of a Node.js project or npm package
by sindresorhusJavaScript
Last 12 weeks · 0 commits
4 of 6 standards met
With ESM modules, Node has introduced a 2nd use for . So now the presence of a file does not necessarily indicate the root of a package. It could just contain to indicate that a subdirectory's files are to be treated as ESM modules. Could check the contents of files found, and ignore any which don't indicate package root? Perhaps checking for a field would do the trick.
Repository: sindresorhus/package-directory. Description: Find the root directory of a Node.js project or npm package Stars: 253, Forks: 21. Primary language: JavaScript. Languages: JavaScript (89.9%), TypeScript (10.1%). License: MIT. Latest release: v8.2.0 (6mo ago). Open PRs: 0, open issues: 0. Last activity: 6mo ago. Community health: 85%. Top contributors: sindresorhus, coreyfarrell, BendingBender, jimmywarting, kellyselden, LinusU, Richienb, SamVerschueren.