New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

swiss-qr-invoice-js

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swiss-qr-invoice-js

creates swiss qr invoices using pdfkit

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
0
Weekly downloads
 
Created
Source

swiss-qr-invoice-js

creates 🇨🇭 qr invoices using pdfkit


Build, Lint and Test Status GitHub issues GitHub pull requests License codecov


⚠️ This project is still in development and not ready for production use. ⚠️
Can't wait to use it? Feel free to contribute.

📝 Table of Contents

🧐 About

swiss-qr-invoice-js is a library that generates 🇨🇭 QR payment sections. It is capable to either generate a PDF file from scratch or attach the section to a given PDFkit document instance.

🏁 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Installing

Install the package via npm:

npm install swiss-qr-invoice-js --save

or via yarn:

yarn add swiss-qr-invoice-js

🎈 Usage

Basic usage

import QRInvoice from 'swiss-qr-invoice-js';

const invoice = new QRInvoice()
  .setAmount(100.0)
  .setCurrency('CHF')
  .setCreditor({
    name: 'Cytex GmbH',
    address: 'Musterstrasse 1',
    zip: '8000',
    city: 'Zürich',
    country: 'CH',
    iban: 'CH9300762011623852957',
    reference: '123456789012345678901234567',
  })
  .setDebtor({
    name: 'Max Muster',
    address: 'Musterstrasse 2',
    zip: '8000',
    city: 'Zürich',
    country: 'CH',
  })
  .setReference('123456789012345678901234567')
  .setAdditionalInformation('Rechnung 2021-01');

// Generate a PDF file
invoice.save('invoice.pdf');

// Attach the QR invoice to an existing PDF document
const pdfDocument = new PDFDocument();
invoice.attachToPDF(pdfDocument);

🔧 Running the tests

Tests are written with jest. You can run them with the following command:

npm run test

⛏️ Built Using

✍️ Authors

Keywords

FAQs

Package last updated on 05 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc