GitShow/sindresorhus/resolve-from
sindresorhus

resolve-from

Resolve the path of a module like require.resolve() but from a given path

by sindresorhus
Star on GitHubForknpm

JavaScript

145 stars14 forks7 contributorsQuiet · 5y agoSince 2014v5.0.0MIT

Meet the team

See all 7 on GitHub →
sindresorhus
sindresorhus22 contributions
SamVerschueren
SamVerschueren3 contributions
coreyfarrell
coreyfarrell1 contribution
BendingBender
BendingBender1 contribution
ranyitz
ranyitz1 contribution
Richienb
Richienb1 contribution
zkochan
zkochan1 contribution

Languages

View on GitHub →
JavaScript92.7%
TypeScript7.3%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 2 discussions · Last activity 5y ago
See all on GitHub →
kwasimensah
Support for not using realpathOpenIssue

https://github.com/sindresorhus/resolve-from/blob/main/index.js#L16 unconditionally uses realpathSync which is a problem in contexts where we don't want to give lstat permissisons to every directory in the hierarchy (sandboxes for example). Node's options let you work around this. I'm running into this because this is how eslint loads it's configuration (through import-fresh). Happy to take a stab at this if this something you want to support in this project.

kwasimensah · 2y ago
zkochan
From version Node v8.9.0, require.resolve() accepts custom pathsOpenIssue

See the new and the updated [](https://nodejs.org/dist/latest-v8.x/docs/api/modules.html#modules_require_resolve_request_options). can use these new exposed functions instead of accessing private functions of Module. Of course, only when they are available.

zkochan · 3y ago

Recent fixes

View closed PRs →
xxiaoxiong
Add `preserveSymlinks` option to skip realpathSyncMergedPR

Summary Adds export to skip calls, allowing module resolution without requiring permissions on every directory in the hierarchy. Changes : Added optional parameter to the internal function; added convenience export Why requires permissions on every directory in the hierarchy, which is a problem in sandboxed environments. When is already enabled at the Node.js level, the extra realpath call is redundant. Closes #18

xxiaoxiong · 1mo ago
NickHeiner
Support for extensions other than `.js`ClosedIssue

I work with TS. I'd like to use to resolve paths to files. However, this module only considers files. Would you consider adding a configurable set of extensions, like what we can do with Webpack?

NickHeiner · 4y ago
Richienb
Move to GitHub ActionsMergedPR
Richienb · 5y ago
Structured data for AI agents

Repository: sindresorhus/resolve-from. Description: Resolve the path of a module like require.resolve() but from a given path Stars: 145, Forks: 14. Primary language: JavaScript. Languages: JavaScript (92.7%), TypeScript (7.3%). License: MIT. Latest release: v5.0.0 (7y ago). Open PRs: 0, open issues: 2. Last activity: 5y ago. Community health: 85%. Top contributors: sindresorhus, SamVerschueren, coreyfarrell, BendingBender, ranyitz, Richienb, zkochan.

·@ofershap

Replace github.com with gitshow.dev