Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

app-root-path

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-root-path - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

index.d.ts

11

lib/resolve.js

@@ -110,4 +110,11 @@ 'use strict';

// resort to require.main.filename (See http://nodejs.org/api/modules.html)
if (alternateMethod || null == appRootPath) {
appRootPath = path.dirname(requireFunction.main.filename);
if ((alternateMethod || null == appRootPath)) {
if (requireFunction.main) {
appRootPath = path.dirname(requireFunction.main.filename);
} else {
// This is the case when app-root-path is bundle'd to a commonjs2 format and is being called from an esm file.
// In those cases require.main is undefined (See https://nodejs.org/api/modules.html#accessing-the-main-module)
// At that point we can only get the root from looking at the callee
appRootPath = path.dirname(process.argv[1]);
}
}

@@ -114,0 +121,0 @@

2

package.json
{
"name": "app-root-path",
"version": "3.0.0",
"version": "3.1.0",
"description": "Determine an app's root path from anywhere inside the app",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -93,2 +93,6 @@ # App Root Path Module

### 3.1.0
- Added TypeScript types
- Added fallback for when `require.main` is missing (ESM imports)
### 3.0.0

@@ -95,0 +99,0 @@ - Improved Yarn Plug'n'Play support

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc