A comprehensive and reliable npm package for fetching and rendering tax information from around the world. Originally started with a focus on Rwanda, this package has expanded to become a universal data provider for tax rates, authorities, and essential fiscal information.
- Global Coverage: Fetch tax details for Rwanda, Kenya, USA, UK, South Africa, and more.
- Dynamic Updates: Remote-fetching architecture ensures you always have the latest rates without updating the package.
- Richer Data: Detailed information including tax authorities, fiscal years, and filing deadlines.
- Developer First: Fully typed API designed for building tax-aware applications and APIs.
- CLI Resource: Instant tax information directly in your terminal.
npm install global-taxesView tax details for any supported country directly from your terminal:
# List all supported countries
npx global-taxes --list
# View details for a specific country (default is RW)
npx global-taxes --country=US
npx global-taxes --country=KEimport { fetchLatestTaxConfig, getCountryTaxes, getSupportedCountries } from 'global-taxes';
async function main() {
// Fetch the latest global configuration
// Use { useLocalOnly: true } to bypass remote fetch and use embedded UUIDs immediately
const config = await fetchLatestTaxConfig({ useLocalOnly: true });
// List all available countries
const countries = getSupportedCountries(config);
// Get specific tax details for Kenya
const kenya = getCountryTaxes(config, 'KE');
if (kenya) {
console.log(`VAT in Kenya: ${kenya.taxes.find(t => t.type === 'VAT')?.rate}%`);
}
}Perfect for creating a centralized data provider for your microservices or frontend:
import { fetchLatestTaxConfig, getCountryTaxes } from 'global-taxes';
export default async function handler(req, res) {
const { countryCode } = req.query;
const config = await fetchLatestTaxConfig();
const data = getCountryTaxes(config, countryCode || 'RW');
if (!data) return res.status(404).json({ error: 'Country not found' });
res.status(200).json({
status: 'success',
data: data,
meta: {
lastUpdated: config.meta.lastUpdated,
version: config.meta.version
}
});
}Currently supporting 53+ countries across 5 continents, including Rwanda, Kenya, Nigeria, Ghana, UK, USA, France, Germany, and many more. Data is updated regularly via remote fetching.
If you find this package useful and would like to support its development and the addition of more countries, please consider sponsoring the project!
Your support helps me maintain the data and add more global tax configurations.
Pascal Niri
- GitHub: @pascalniri
- Portfolio: pascalkid.vercel.app
MIT