@offset-earth/certificates

`npm publish` to publish the latest version. ![certificate](./__tests__/fixtures/certificate.png)

Usage no npm install needed!

<script type="module">
  import offsetEarthCertificates from 'https://cdn.skypack.dev/@offset-earth/certificates';
</script>

README

Ecologi Certificate Generator

npm publish to publish the latest version. certificate

Create local gift certificate

If you need to re-create a gift cert for support reasons etc you can uncomment the fs.writeFile line and the generateGiftCard line at the bottom of the src/gift.ts file.

Add the couponCode you want to the options object and then run yarn make-local-cert! The gift.pdf file should appear in the root dir.

API

  • Using a Buffer:

    function generateCertificate(
      content: {
        name: string;
        totalTons: number;
        projects: { name: string; tons: number }[];
        startDate: Date;
        endDate: Date;
        issuedAt: Date;
        id: string;
      },
    ): Promise<Buffer>;
    
    
  • Using a Stream:

    function generateCertificate(
      content: {
        name: string;
        totalTons: number;
        projects: { name: string; tons: number }[];
        startDate: Date;
        endDate: Date;
        issuedAt: Date;
        id: string;
      },
      outputStream: NodeJS.WritableStream,
    ): void;
    

Publishing a new version

  • Update the version in package.json
  • npm publish