Skip to content
/ panam Public

One tool to rule all runtimes and package managers.

License

Notifications You must be signed in to change notification settings

siguici/panam

Repository files navigation

Panam ⚑

A universal tool for executing commands across multiple package managers, independent of runtime or environment. Supporting popular tools like npm, cnpm, pnpm, yarn, bun, deno, and even jsr, it provides a consistent interface to simplify development workflows and automate tasks, regardless of the package manager being used.

This monorepo contains two main packages:

  1. Panam: The core programmatic API for interacting with package managers.
  2. Panam CLI: The command-line interface for Panam.

πŸš€ Features

  • 🌍 Cross-runtime compatibility: Works seamlessly with the most popular package managers like npm, cnpm, pnpm, yarn, bun, deno, and jsr.
  • 🎯 Unified interface: One tool to handle commands across different managers, so you can focus on building.
  • ⚑ Performance optimized: Executes commands efficiently with runtime detection and intelligent fallback strategies.
  • πŸ”§ Future-ready: Easily extendable to support new package managers.
  • πŸ› οΈ Command flexibility: Support for install, add, remove, run, exec, and dlx commands with consistent behavior across environments.
  • πŸ“‚ Custom detection: Automatically detects the appropriate package manager for a given project or allows explicit specification.

πŸ“‚ Packages

1. Panam core

The panam package provides a programmatic interface for developers who want to integrate Panam functionality into their own applications.

2. Panam CLI

The panam-cli package offers a command-line interface to execute Panam commands directly in your terminal.


πŸš€ Installation

Install the specific Panam package based on your needs using your preferred package manager:

Install Panam

  • With NPM:

    npm install panam
  • With Yarn:

    yarn add panam
  • With PNPM:

    pnpm add panam
  • With Bun:

    bun add panam
  • With Deno:

    deno add --allow-scrits npm:panam

Install Panam CLI

  • With NPM:

    npm install -g panam-cli
  • With Yarn:

    yarn global add panam-cli
  • With PNPM:

    pnpm add -g panam-cli
  • With Bun:

    bun install -g panam-cli
  • With Deno:

    deno install --allow-scripts npm:panam-cli

πŸ§‘β€πŸ’» Usage

Run a command

Panam automatically detects the active package manager for your project:

pnm install

Execute a script

Run a script defined in your package.json:

pnm run <script-name>

Use exec or dlx

Panam adapts commands like exec or dlx for compatibility across package managers:

pnm exec vite --template vue

πŸ’‘ Examples

Install dependencies

pnm install

Add a package

pnm add @qwikdev/astro

Remove a package

pnm remove @qwikdev/astro

Create a new project

pnm create @qwikdev/astro my-qwik-astro-app

Execute a global tool

pnm exec @qwikdev/create-astro .

Use dlx to run a package without installing it globally

pnm dlx @qwikdev/create-astro my-qwik-astro-app

πŸ› οΈ Programmatic API

Panam also exposes a powerful programmatic API for advanced use cases:

import pnm from 'panam';

const version = await pnm.version();
console.log(`Current runtime version: ${version}`);

await pnm.help(); // Show the runtime help message

await pnm.pm.$('install');

await pnm.install();

await pnm.create('@qwikdev/astro');

await pnm.add('@qwikdev/astro');

await pnm.run('create-astro');

await pnm.exec('astro add @qwikdev/astro');

await pnm.dlx('@qwikdev/create-astro my-qwik-astro-app');

await pnm.x('astro add @qwikdev/astro');

πŸ“– Supported Package Managers

Panam currently supports the following package managers:

  • βœ… npm
  • βœ… cnpm
  • βœ… pnpm
  • βœ… yarn
  • βœ… bun
  • βœ… deno
  • βœ… jsr

More package managers can be added with ease.


πŸ“š Documentation

Go to https://siguici.github.io/panam for more documentation and usage examples.


πŸ›‘οΈ License

Under the MIT License. Created with ❀️ by Sigui Kessé Emmanuel.