This library includes tools to fetch and save package information from pkgx.dev.
npm install ts-pkgx
bun install ts-pkgx
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
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`)
bun test
bun test
Please see our releases page for more information on what has changed recently.
Please see CONTRIBUTING for details.
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
For casual chit-chat with others using this package:
Join the Stacks Discord Server
"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 🌎
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.
The MIT License (MIT). Please see LICENSE for more information.
Made with 💙