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

@alienfast/find-monorepo-root

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alienfast/find-monorepo-root

Find the root path of a monorepo using various strategies.

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

MIT Version CI PRs Welcome

@alienfast/find-monorepo-root

Find the root directory of a monorepo using any of the following strategies:

  • Lerna
  • Yarn
  • Bolt
  • pnpm
  • npm

Install

yarn install @alienfast/find-monorepo-root

Usage

npx

For easy use in a shell script anywhere in your monorepo, execute with the -y

npx -y @alienfast/find-monorepo-root
# output: /Users/rosskevin/projects/archetype

or

#!/usr/bin/env bash

ROOT=`npx -y @alienfast/find-monorepo-root`

echo "My monorepo root is ${ROOT}"

Api

import { findMonorepoRoot } from '@alienfast/find-monorepo-root'
const cwd = process.cwd()

console.log(await findMonorepoRoot(cwd))
// {
//   strategy: 'lerna', // 'bolt' | 'yarn' | 'pnpm' | 'lerna' | 'npm'
//   dir: '/Users/rosskevin/projects/archetype',     // the monorepo root directory
// }

Contributing

PRs are accepted! This project is configured with auto, so feel free to submit a PR and auto will automatically create a canary release for you to try out.

Prior art

This was originally forked from https://github.com/bubkoo/find-monorepo-root/ because it a) did not work for me in it's current form; and b) I wanted to exec it simply with npx. Thanks to the original author and contributors.

Keywords

FAQs

Package last updated on 26 Aug 2023

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