mwg API
    Preparing search index...

    Function generateCredits

    • The credits text for the packages present, in the format of the CREDITS.txt the asset step writes: one block per package and per asset, each with its licence and, when known, its source.

      Parameters

      • documents: readonly PackageDocument[]
      • options: { support?: { label?: string; url: string } } = {}

      Returns string

      import { generateCredits, parsePackageDocument } from '@datamoc/mwg/mwl';

      const document = parsePackageDocument(
      "[{ tag: 'package', id: 'marta', version: '1.0.0', author: 'Ada', license: 'CC-BY-4.0' }]",
      );
      console.log(generateCredits([document])); // 'marta 1.0.0 by Ada\nLicense: CC-BY-4.0\n'

      A game that wants a "take part in the project" line passes it as options.support; nothing is added unless it does, and only an http: or https: address is accepted.