Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
eu-vat
Advanced tools
Readme
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.
The npm package eu-vat receives a total of 5 weekly downloads. As such, eu-vat popularity was classified as not popular.
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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.