Introduction

Package management utilities for monorepos, package detection, and package.json parsing

Last updated:

@visulima/package

Comprehensive package management utilities for finding monorepo roots, detecting package managers, and parsing package.json, package.yaml, and package.json5 files.

Key Features

  • Monorepo Detection - Find monorepo roots (pnpm, npm, yarn, Lerna, Turborepo)
  • Package Detection - Locate package roots and package.json files
  • Multi-Format Support - Parse package.json, package.yaml, and package.json5
  • Catalog Resolution - Resolve pnpm catalog dependencies
  • Package Manager Detection - Identify which package manager is used
  • TypeScript - Full type definitions

Quick Start

import { findMonorepoRoot, findPackageJson } from "@visulima/package";

// Find monorepo root
const monorepo = await findMonorepoRoot();
console.log(monorepo.strategy); // "pnpm" | "npm" | "yarn" | "lerna"

// Find and parse package.json
const pkg = await findPackageJson();
console.log(pkg.packageJson.name);

Use Cases

// Monorepo tooling
import { findMonorepoRoot } from "@visulima/package";

async function setupMonorepo() {
    const root = await findMonorepoRoot();
    if (root) {
        console.log(`Found ${root.strategy} monorepo at ${root.path}`);
    }
}

// Build tools
import { findPackageJson } from "@visulima/package";

const { packageJson } = await findPackageJson();
const version = packageJson.version;

Next Steps

Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues