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

app-root-dir

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-root-dir

Simple module to infer the root directory of the currently running node application

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.5M
decreased by-4.94%
Maintainers
1
Weekly downloads
 
Created

What is app-root-dir?

The app-root-dir npm package is a simple utility that helps you find the root directory of your Node.js application. This can be particularly useful when you need to access files or directories relative to the root of your project, regardless of where your script is being executed from.

What are app-root-dir's main functionalities?

Get the root directory

This feature allows you to get the root directory of your Node.js application. The code sample demonstrates how to use the `get` method from the app-root-dir package to retrieve and print the root directory path.

const appRootDir = require('app-root-dir').get();
console.log(appRootDir);

Set the root directory

This feature allows you to set a custom root directory for your Node.js application. The code sample demonstrates how to use the `set` method to define a new root directory and then retrieve it using the `get` method.

const appRootDir = require('app-root-dir');
appRootDir.set('/path/to/new/root');
console.log(appRootDir.get());

Other packages similar to app-root-dir

Keywords

FAQs

Package last updated on 28 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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