Module that determines your Node.js application’s root path so code can reference files from anywhere without relying on relative paths. Useful for constructing absolute module paths and supports edge cases like global CLI installs, Yarn Plug’n’Play, webpack, and fallback behavior when require.main is missing (ESM imports).
Project status
- The repository appears quiet and likely not actively maintained, with the last upstream push on 2022-11-01 and no further documented updates after 2022-08-02, which is about 3 years ago relative to 2026-08-12.
- Update cadence is low, with major updates/releases in 2019 (v2.1.0, 3.0.0) and then a later update in 2022 (3.1.0), suggesting an extended gap rather than an ongoing release stream.
AI summary generated
Recent updates
3.1.0
Release 3.1.0 adds TypeScript declaration files and improves runtime behavior when the module is used in environments where `require.main` is not available. The code change specifically guards access to `requireFunction.main` and falls back to deriving the app root from the current process arguments.
Featuresv2.1.0
No release notes were provided for v2.1.0. The actual diff only touches repository configuration (gitignore, CI, README) and dev tooling (package.json scripts and devDependencies), with no application/library source code changes shown.
3.0.0
Release 3.0.0 claims improved Plug'n'Play and Webpack support. The code diff shows changes specifically targeted at pnpm-style node_modules layouts ('.pnpm') and a modification to how the fallback app root is determined under bundlers.
Features2.2.1
Release 2.2.1 is described as a fix for loading issues when bundled with webpack. The code change focuses on how dependencies are required under webpack and adjusts resolution behavior in Electron and Yarn Plug'n'Play contexts.
2.2.0
Release 2.2.0 focuses on supporting Yarn Plug'n'Play, adjusting the browser shim to reduce webpack warnings, and raising the minimum supported Node.js version to 6. The code diff shows additional runtime environment detection logic beyond what is stated in the release notes.
Featuresv2.0.0
Version 2.0.0 focuses on browserify/browser support and a change to how appRootPath.require behaves. The code diff shows additional compatibility work (Electron remote loading) and a Node.js engine constraint that are not fully covered by the release notes.
BreakingFeatures1.2.1
Release 1.2.1 updates app-root-path’s resolution logic to better handle Electron renderer processes and globally installed CLI edge cases. It also fixes a bug where calling setPath() did not update the exported .path value, and refactors some work so it is computed outside the resolve() function.
1.0.0
Release 1.0.0 is described as a locked API. The provided diff shows no application code changes, only documentation updates and metadata/dependency tweaks (version, README, and a devDependency).
0.1.1
Release 0.1.1 focuses on improving path resolution to support non-POSIX path separators. Specifically, it updates how the module detects and splits around the `node_modules` directory so it works with Windows-style paths.
Features0.1.0
This release (0.0.1 to 0.1.0) substantially rewrites how the package determines the application root path and changes how the public API is exported and tested. No release notes were provided by the publisher, so the documented change set is effectively empty.
0.0.1
This release is the initial v0.0.1 publication. There are no release notes describing features, fixes, or changes beyond stating it is the first release.