-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Description
According to the docs, the only option currently on require.resolve(path[, options]) is paths. I have a project that I'm trying to eliminate a dependency on browserify/resolve, and the only thing holding me back is that my library needs to know the resolved path of a given string while preserving symlinks, regardless of whatever the end-user has set their global Node environment to.
I propose a second option be added to this method named preserveSymlinks which behaves the same way as the --preserve-symlinks CLI flag and ENV var, but is local only to the call on require.resolve().
I attempted to work around this by changing the NODE_PRESERVE_SYMLINKS env var at runtime, but it had no effect.
If this seems like an agreeable enhancement to require.resolve, I'd happily take a stab at a PR