Introduction to ts-pkgx
A TypeScript library for fetching and working with pkgx.dev package information
ts-pkgx is a specialized library that provides tools for fetching, storing, and accessing package data from pkgx.dev. It offers both programmatic APIs and CLI tools for developers who want to work with pkgx packages in their TypeScript applications.
What is pkgx?
pkgx.dev is a package manager that simplifies the installation of development tools and dependencies. It provides a central repository of packages that can be easily installed and managed.
Core Features
- Package Fetching: Retrieve detailed package information from pkgx.dev
- TypeScript Integration: Fully typed interfaces for all package data (see TypeScript Types)
- Multiple Package Fetching: Fetch multiple specific packages at once with the
--pkg
option - Optimized Batch Processing: Efficiently process hundreds of packages with configurable concurrency
- CLI Tools: Comprehensive command line utilities for fetching and managing packages
- Alias Support: Handle package aliases (e.g., "node" for "nodejs.org")
- Nested Paths: Support for packages with nested paths (e.g., "agwa.name/git-crypt")
- Smart Caching: Configurable caching system to improve performance and avoid hitting rate limits
- TypeScript Code Generation: Convert package data into TypeScript files for easy use
- Index Generation: Automatically create indexes for easy access to all packages
- JSON Output: Option to output as JSON instead of TypeScript
- Compiled Binaries: Use pre-compiled binaries for various platforms
- Advanced Error Handling: Robust error handling with automatic retries
Why ts-pkgx?
ts-pkgx simplifies the process of working with pkgx.dev package data in TypeScript projects. Instead of manually scraping the pkgx.dev website or trying to parse package information yourself, ts-pkgx provides a clean, type-safe interface for accessing this data.
Get Started
To start using ts-pkgx in your project, check out the Installation guide.
# Install with bun
bun install ts-pkgx
# Quick example: fetch package info
bun run pkgx:fetch node
Project Structure
The project follows a clean and maintainable structure:
src/
: Source code for the librarypackages/
: Package definitions and utilitiestools/
: Utility scripts for package handlingtypes.ts
: TypeScript interfaces
bin/
: CLI toolstest/
: Comprehensive test suite
Changelog
Please see our releases page for information on changes.
Contributing
Please see CONTRIBUTING for details.
Community
For help or discussion:
Postcardware
"Software that is free, but hopes for a postcard." We love receiving postcards from around the world showing where Stacks is being used! We showcase them on our website too.
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎
Credits
- Max Howell - for creating pkgx and Homebrew
- pkgm & dev - thanks for the inspiration
- Chris Breuer
- All Contributors
Sponsors
We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.
License
The MIT License (MIT). Please see LICENSE for more information.
Made with 💙