New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@types/find-root

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/find-root

TypeScript definitions for find-root

1.1.1
ts2.2
ts2.3
ts2.4
ts2.5
ts2.6
ts2.7
ts2.8
ts2.9
ts3.0
Source
npm
Version published
Maintainers
1
Created

What is @types/find-root?

@types/find-root is a TypeScript type definition package for the find-root library. The find-root library is used to find the root directory of a project by looking for a specific file (usually package.json) in the current directory or its ancestors.

What are @types/find-root's main functionalities?

Find the root directory of a project

This feature allows you to find the root directory of a project by searching for a specific file (default is package.json) starting from the current directory and moving up the directory tree.

const findRoot = require('find-root');
const root = findRoot(__dirname);
console.log(root);

Find the root directory with a custom file

This feature allows you to find the root directory of a project by searching for a custom file instead of the default package.json.

const findRoot = require('find-root');
const root = findRoot(__dirname, (dir) => require('fs').existsSync(require('path').join(dir, 'custom-file.txt')));
console.log(root);

Other packages similar to @types/find-root

FAQs

Package last updated on 23 Mar 2018

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