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

vat-number-validator

v1.0.3

Published

A package for validating VAT numbers

Downloads

286

Readme

VAT Number Validator 🔍🔍🔍

npm version build github sponsors

Why Validating VAT Codes is Important

Validating VAT (Value Added Tax) codes is crucial for businesses operating internationally or within countries with complex tax regulations. VAT codes are unique identifiers assigned to businesses for tax purposes. Ensuring the validity of these codes helps businesses avoid errors in invoicing, comply with tax laws, and prevent potential legal issues.

Benefits of Validating VAT Codes

  • Accurate Invoicing: Valid VAT codes ensure accurate invoicing, reducing the risk of financial discrepancies and payment delays.

  • Compliance with Tax Laws: Many countries have strict regulations regarding VAT registration and reporting. Validating VAT codes helps businesses comply with these laws and avoid penalties.

  • Prevention of Fraud: Invalid VAT codes may indicate fraudulent activities such as tax evasion. Validating VAT codes helps detect and prevent such fraud.

  • International Trade: Valid VAT codes are essential for businesses involved in international trade to claim VAT refunds and ensure smooth transactions.

  • Trust and Reputation: Ensuring the validity of VAT codes enhances the trust and reputation of businesses, especially when dealing with customers and partners.

Package Completeness ✅

This TypeScript package provides comprehensive VAT code validation functionality. Unlike similar packages, it offers a more thorough validation process, minimizing false positives and ensuring accurate results.

Remaining Development Goals 🛠️

While the package is already robust, there are ongoing efforts to enhance its capabilities:

  • Fix False Positives: Address any false positives in the existing regular expressions to improve accuracy.
  • Exhaustive Unit Tests: Develop a comprehensive suite of unit tests to thoroughly validate the package's functionality and ensure its reliability.
  • Additional API Functionality: Expand the package's API to provide more advanced features and options for users.

Legal Notice 📜

Note for Users: This package is distributed under the GNU General Public License Version 3 (GPL-3.0). This license grants users the freedom to use, modify, and distribute the software, with the condition that any derivative works are also licensed under GPL-3.0. It's important to review and understand the terms of this license before using the package in your projects.

Contributing Guidelines 🤝

Note for Contributors: We welcome contributions to improve and enhance this package. If you'd like to contribute, please follow these guidelines:

  • Write Unit Tests: Ensure any changes or additions are accompanied by corresponding unit tests to maintain code quality and reliability.
  • Development Process: To contribute, open a pull request (PR) targeting the develop branch. This allows for collaborative development and ensures that changes are properly reviewed before merging into the main codebase.

:toolbox: Functions

:gear: isValidCountryVat

| Function | Type | | ---------- | ---------- | | isValidCountryVat | (vat: string, country: Country) => boolean |

:gear: isValidVat

| Function | Type | | ---------- | ---------- | | isValidVat | (vat: string) => boolean |

:gear: getErrorMessage

| Function | Type | | ---------- | ---------- | | getErrorMessage | (country: Country) => string |

:wrench: Constants

:gear: countryRegexMap

| Constant | Type | | ---------- | ---------- | | countryRegexMap | Map<Country, string> |

:gear: countryErrorMessageMap

| Constant | Type | | ---------- | ---------- | | countryErrorMessageMap | Map<Country, string> |

:gear: countrySpecialCaseMap

| Constant | Type | | ---------- | ---------- | | countrySpecialCaseMap | Map<Country, (vat: string) => boolean> |

:nut_and_bolt: Enum

:gear: Country

| Property | Type | Description | | ---------- | ---------- | ---------- | | Albania | 'Albania' | | | Argentina | 'Argentina' | | | Australia | 'Australia' | | | Austria | 'Austria' | | | Belarus | 'Belarus' | | | Belgium | 'Belgium' | | | Belize | 'Belize' | | | Bolivia | 'Bolivia' | | | BosniaHerzegovina | 'Bosnia Herzegovina' | | | Brazil | 'Brazil' | | | Bulgaria | 'Bulgaria' | | | Canada | 'Canada' | | | Chile | 'Chile' | | | China | 'China' | | | Colombia | 'Colombia' | | | CostaRica | 'Costa Rica' | | | Croatia | 'Croatia' | | | Cyprus | 'Cyprus' | | | CzechRepublic | 'Czech Republic' | | | Denmark | 'Denmark' | | | DominicanRepublic | 'Dominican Republic' | | | Ecuador | 'Ecuador' | | | ElSalvador | 'El Salvador' | | | Estonia | 'Estonia' | | | Finland | 'Finland' | | | France | 'France' | | | Germany | 'Germany' | | | Greece | 'Greece' | | | Guatemala | 'Guatemala' | | | Hungary | 'Hungary' | | | Iceland | 'Iceland' | | | India | 'India' | | | Indonesia | 'Indonesia' | | | Ireland | 'Ireland' | | | IsleOfMan | 'Isle of Man' | | | Israel | 'Israel' | | | Italy | 'Italy' | | | Japan | 'Japan' | | | Kazakhstan | 'Kazakhstan' | | | Latvia | 'Latvia' | | | Lithuania | 'Lithuania' | | | Luxembourg | 'Luxembourg' | | | Malta | 'Malta' | | | Mexico | 'Mexico' | | | Monaco | 'Monaco' | | | Netherlands | 'Netherlands' | | | NewZealand | 'New Zealand' | | | Nicaragua | 'Nicaragua' | | | Nigeria | 'Nigeria' | | | NorthMacedonia | 'North Macedonia' | | | Norway | 'Norway' | | | Paraguay | 'Paraguay' | | | Peru | 'Peru' | | | Philippines | 'Philippines' | | | Poland | 'Poland' | | | Portugal | 'Portugal' | | | Romania | 'Romania' | | | Russia | 'Russia' | | | SanMarino | 'San Marino' | | | SaudiArabia | 'Saudi Arabia' | | | Serbia | 'Serbia' | | | Slovakia | 'Slovakia' | | | Slovenia | 'Slovenia' | | | Spain | 'Spain' | | | Sweden | 'Sweden' | | | Switzerland | 'Switzerland' | | | Taiwan | 'Taiwan' | | | Turkey | 'Turkey' | | | Ukraine | 'Ukraine' | | | UnitedKingdom | 'United Kingdom' | | | Uruguay | 'Uruguay' | | | Uzbekistan | 'Uzbekistan' | | | Venezuela | 'Venezuela' | |