Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A tiny utility to retrieve vat rates for the EU. Useful for Ecommerce platforms and projects.
This eu-vat
module is a tiny package the helps retrieve vat rates for EU countries. It makes use of the json-vat api to retrieve the most recent vat rates for EU countries. This library can be easily plugged into your ecommerce platforms if you need to calculate cost related to vat e.g. shiiping cost etc.
This package has been published on NPM and is freely available according to the MIT license. To install via npm simply run npm install eu-vat
.
const EuroVat = require('eu-vat');
const vat = new EuroVat();
vat.getRates('FI').then((rates) => {
console.log(rates);
// Do something with rates
});
/* Alternative style using async await */
const getRates = async () => {
const rates = await vat.getRates('RO');
console.log(rates);
// Do something with rates
}
The utility returns a resolved or rejected promise.
This module exposes one primary functions getRates
. The getRates
function accepts just one argument countryCode
. The get rate function returns a promise.
Accepted method argument
The countryCode {Optional}
- This refers to the ISO2 country code of the European country whose tax rate is to be retrieved. This argument is optional i.e if no countryCode is passed, the function will return a list countaining objects of each countries tax rates. This argument compulsorily has to be a string if passed of course :). Kindly see the next section for a list of supported countries.
Returned Value
The returned value largely depends on if a countryCode is passed, however the returned value is always a Promise, although using the async/await syntax one could easily mimick real time data handling. For a getRates
request with a countryCode passed, say Romanian countryCode RO
, the following should be an expected response.
{
name: 'Romania',
countryCode: 'RO',
periods:
{ effective_from: '2017-01-01',
rates: {
reduced1: 5, reduced2: 9, standard: 19
}
}
}
name: 'Spain', countryCode: 'ES'
name: 'Bulgaria', countryCode: 'BG'
name: 'Hungary', countryCode: 'HU'
name: 'Latvia', countryCode: 'LV'
name: 'Poland', countryCode: 'PL'
name: 'United Kingdom', countryCode: 'GB'
name: 'Czech Republic', countryCode: 'CZ'
name: 'Malta', countryCode: 'MT'
name: 'Italy', countryCode: 'IT'
name: 'Slovenia', countryCode: 'SI'
name: 'Ireland', countryCode: 'IE'
name: 'Sweden', countryCode: 'SE'
name: 'Denmark', countryCode: 'DK'
name: 'Finland', countryCode: 'FI'
name: 'Cyprus', countryCode: 'CY'
name: 'Luxembourg', countryCode: 'LU'
name: 'Romania', countryCode: 'RO'
name: 'Estonia', countryCode: 'EE'
name: 'Greece', countryCode: 'GR'
name: 'Lithuania', countryCode: 'LT'
name: 'France', countryCode: 'FR'
name: 'Croatia', countryCode: 'HR'
name: 'Belgium', countryCode: 'BE'
name: 'Netherlands', countryCode: 'NL'
name: 'Slovakia', countryCode: 'SK'
name: 'Germany', countryCode: 'DE'
name: 'Portugal', countryCode: 'PT'
name: 'Austria', countryCode: 'AT'
FAQs
A tiny utility to retrieve vat rates for the EU. Useful for Ecommerce platforms and projects.
We found that eu-vat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.