Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 982 Bytes

File metadata and controls

22 lines (16 loc) · 982 Bytes

GitHub package.json version npm bundle size GitHub Workflow Status NPM

lup-root

Node module that determines absolute path to project root and main file of project

Example

import { getApplicationRoot, getProjectRoot, getScriptMain } from "lup-root";

// Absolute path to the main file that started the application.
console.log('Main file: ' + getScriptMain());,

// Absolute path to the root of the application directory (actual root of the app inside a monorepo).
console.log("Application root: " + getApplicationRoot());

// Absolute path to the root directory of the project (monorepo root if the application is inside a monorepo).
console.log("Project root: " + getProjectRoot());