typgrap
v0.2.1
Published
A library for creating and using a type graph
Downloads
1
Readme
typgrap
A minimal CLI to install packages with their corresponding @types – with support for Bun, PNPM, and NPM.
Features
- Automatically installs the
@types/<package>if available - Supports
bun,pnpm, andnpm - Detects package manager from lockfiles or user config
- Customizable via
.typgrap.json - Clean and modern CLI UX
- Built with Bun for fast performance
Installation
Coming soon to npm...
npm install -g typgrapor
bun add -g typgrapUsage
typgrap install expressThis will:
- Detect your package manager (bun, pnpm, npm)
- Install
express - Try to install
@types/expressif available
Configuration
You can create a .typgrap.json file at the root of your project to set default options:
{
"defaultPackageManager": "bun"
}This overrides auto-detection and always uses the specified package manager.
How It Works
- Detects the package manager by checking for:
bun.lockb→ Bunpnpm-lock.yaml→ PNPMpackage-lock.json→ NPM
- Installs your package using the correct command
- Checks if a matching
@types/package exists - Installs it as a dev dependency if found
CLI Options (coming soon)
--no-types→ skip installing@types--force→ override existing installations--config <path>→ specify a custom config file path
Example
typgrap install mongooseIf you're using Bun, the tool will run:
bun add mongoose && bun add -d @types/mongooseOnly if @types/mongoose exists.
Author
Created by Ahmed Khalid (@ahmedkhalid-dev)
License
MIT
