Skip to content

agonyz/packagist-api-client

Repository files navigation

Packagist Logo

Packagist Api Client

Badge Badge Badge

Api client for the Packagist Api

Install

npm i @agonyz/packagist-api-client

Best practices

See Packagist API best practices

// set an userAgent with some sort of contact information
const packagistApi: PackagistApi = new PackagistApi('my-example-implementation - contact: [email protected]');

Usage

Import

import PackagistApi from "@agonyz/packagist-api-client";
import {Package} from "@agonyz/packagist-api-client/lib/interfaces";

const packagistApi: PackagistApi = new PackagistApi();
packagistApi.getPackageInfo('agonyz/contao-countdown-bundle')
    .then((packageInformation: Package) => console.log(packageInformation));

Require

var packagistApiClient = require("@agonyz/packagist-api-client").default

const packagistApi = new packagistApiClient();
packagistApi.getPackageInfo('agonyz/contao-countdown-bundle')
    .then(packageInformation => console.log(packageInformation));