npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

infakt

v1.5.3

Published

You want to use inFakt API in the simplest way? Then download this module!

Downloads

4

Readme

inFakt

You want to use inFakt API in the simplest way? Then download this module!

Installation

Install infakt with npm

npm install infakt

How to use

Examples of inFakt module usage

Generate option

import { Generate } from "infakt"
const generate = new Generate("inFakt API Key", true/false) // true and false is sandbox option
const result = await generate.createInvoice({  // your own JSON data based on your preferences if you want more examples go to inFakt API Docs and see on your own what you can add here
    "invoice": {
        "payment_method": "cash",
        "client_company_name": "Testowa JDG",
        "client_first_name": "Pani",
        "client_last_name": "Przykład",
        "client_business_activity_kind": "self_employed",
        "client_street": "Uliczna",
        "client_street_number": "1",
        "client_flat_number": "2",
        "client_city": "Miastowo",
        "client_post_code": "11-111",
        "client_tax_code": "9452121681",
        "client_country": "PL",
        "services": [
            {
                "name": "Przykładowa Usługa",
                "net_price": 16623,
                "pkwiu": "84.11.12.0",
                "unit_net_price": 6623,
                "tax_symbol": 23
            }
        ]
    }
})

Check options

import { Check } from "infakt"
const check = new Check("inFakt API Key", true/false) // true and false is sandbox option
const allInvoices = await check.allInvoices() // returns all invoices created on your API key
const invoiceById = await check.invoiceById("invoice UUID") // returns invoice data based on UUID of invoice
const invoiceStatus = await check.invoiceStatus("invoice Reference Number") // return invoice status of creation

Change options

import { Change } from "infakt"
const change = new Change("inFakt API Key", true/false) // true and false is sandbox option
const setAsPaid = await change.setInvoiceAsPaid("invoice UUID") // sets invoice as paid
const deleteInvoice = await change.deleteInvoice("invoice UUID") // deletes invoice from inFakt

Send option

import { Send } from "infakt"
const send = new Send("inFakt API Key", true/false) // true and false is sandbox option
const sendMail = await send.sendToEmail("invoice UUID", "email") // sends email with invoice as PDF to mail

Example response

Without Error

{ response: "markedAsPaid" }

With Error

{ response: "If there was an error with the request and the status code is 401, it is most likely due to an incorrect apiKey or you have not set the sandbox value in the class definition. If the status code is 404, it means that the invoiceUUID is incorrect. If an error code of 422 appears, it indicates that function params may be bad!" , error : "Here is status code from Axios" }

inFakt Documentation

https://docs.infakt.pl/

Author

Oskar Kapica https://github.com/kapicaoskar