Skip to content

stacksjs/ts-pkgx

Repository files navigation

Social Card of this repo

npm version GitHub Actions Commitizen friendly

ts-pkgx

This library includes tools to fetch and save package information from pkgx.dev.

Installation

npm install ts-pkgx
bun install ts-pkgx

Usage

CLI Tool

The library includes a CLI tool to fetch packages from pkgx.dev:

# Fetch a single package
bun run pkgx:fetch node

# With custom output directory
bun run pkgx:fetch node --output ./data/packages

# Fetch all packages
bun run pkgx:fetch-all

# Set a custom timeout (milliseconds)
bun run pkgx:fetch-all --timeout 180000 --output ./data/pkgx-packages

Programmatic Usage

You can also use the library programmatically in your code:

import { fetchAndSaveAllPackages, fetchPkgxPackage } from 'ts-pkgx'

// Fetch a single package
const nodePackage = await fetchPkgxPackage('node')
console.log(nodePackage)

// Fetch and save all packages
const savedPackages = await fetchAndSaveAllPackages({
  timeout: 120000
})
console.log(`Saved ${savedPackages.length} packages`)

Running Tests

bun test

Testing

bun test

Changelog

Please see our releases page for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

Discussions on GitHub

For casual chit-chat with others using this package:

Join the Stacks Discord Server

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 🌎

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 💙

About

Automated TypeScript types. And utilities.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published