sindresorhus

resolve-from

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

by sindresorhus

JavaScript

JavaScript92.7%
TypeScript7.3%

Commit activity

Last 12 weeks · 1 commit

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

Active · 2 discussions · Last activity 1mo ago
See all on GitHub →
kwasimensah

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 · 3y ago
zkochan

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
xxiaoxiong

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 · 4mo ago
NickHeiner

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 · 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: 13. 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: 1mo ago. Community health: 85%. Top contributors: sindresorhus, SamVerschueren, coreyfarrell, BendingBender, ranyitz, Richienb, zkochan.