Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 1.1 KB

File metadata and controls

45 lines (32 loc) · 1.1 KB

publiccode.ts

TypeScript types and constants for the publiccode.yml spec.

Versioning

This package follows the publiccode.yml spec version, not its own semver. 0.5.x targets spec v0.5, 0.6.x will target spec v0.6, and so on.

Install

npm install @publiccodeyml/types

Usage

import type { PublicCode } from '@publiccodeyml/types';
import { categories, scopes, developmentStatuses } from '@publiccodeyml/types';

function describe(pc: PublicCode) {
  return `${pc.name} (${pc.softwareType ?? 'unknown'})`;
}

What it provides

  • PublicCode interface covering the full spec
  • Supporting interfaces: PublicCodeDescription, PublicCodeMaintenance, PublicCodeContact, PublicCodeLegal, PublicCodeIntendedAudience
  • Software interface for { id, publiccode } pairs as returned by software-catalog-api
  • categories, scopes, developmentStatuses constants

This package is types only. It does not parse or validate YAML at runtime.

License

BSD-3-Clause. Authors and contributors are tracked in the git log.