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 🙏

© 2026 – Pkg Stats / Ryan Hefner

afreumtoolkits

v0.1.0

Published

Official Afreum developer toolkit/SDK for the Afreum Ecosystem public JSON data (tokens, geo, logos) on the Stellar chain.

Readme

Afreumsdk-json

afreumtoolkits

The official Afreum developer toolkit/SDK, published by Afreum. It wraps the Afreum Ecosystem public JSON data — tokens, geo, and logos — behind a typed, cached, promise-based API built for the Stellar chain.

This package does not host or modify Afreum's data; it fetches the same JSON/IPFS endpoints published in Afreum/json and gives you convenient methods, TypeScript types, in-memory caching, and helper lookups on top.

Maintained by the Afreum team. Data source, field definitions, and licensing for the underlying JSON files belong to Afreum (GPL-3.0). This SDK's own code is MIT-licensed.

Install

npm install afreumtoolkits

Requires Node 18+ (for global fetch), or pass your own fetchImpl for older runtimes.

Quick start

import { AfreumClient } from "afreumtoolkits";

const afreum = new AfreumClient();

// Tokens
const allTokens = await afreum.tokens.all();
const flexible = await afreum.tokens.flexible();
const afr = await afreum.tokens.findBySymbol("AFR");

// Geo
const countries = await afreum.geo.countries();
const nigeria = await afreum.geo.findCountryByIso("NG");
const lagosCities = await afreum.geo.citiesByProvince(306);

// Logos (no network call — just builds the URL)
const afrLogo = afreum.logos.afreumTokenUrl("AFR");
const btcLogo = afreum.logos.tokenUrl("BTC");

Why use this instead of calling the JSON URLs directly?

  • Typed responses — every endpoint has a matching TypeScript interface (AfreumToken, AfreumCountry, AfreumCity, etc.), based on the field definitions in the Afreum/json README.
  • In-memory caching — repeat calls within the TTL window (default 5 minutes) reuse the previous response instead of re-downloading, which matters for the large geo/city files.
  • In-flight de-duplication — if you call the same endpoint twice before the first response lands, both callers share one network request.
  • Convenience lookups — findBySymbol, findCountryByIso, africanTokens, activeTokens, africanCountries save you from writing the same .find()/.filter() boilerplate.
  • Swappable base URLs — point tokenBaseUrl / geoBaseUrl / logoBaseUrl at a different IPFS gateway, a pinned mirror, or a local cache without touching your code.

API

new AfreumClient(options?)

| Option | Type | Default | Description | |---|---|---|---| | tokenBaseUrl | string | Afreum's published token IPNS base | Base URL for token JSON files | | geoBaseUrl | string | Afreum's published geo IPNS base | Base URL for geo JSON files | | logoBaseUrl | string | Afreum's published logo IPNS base | Base URL for logo PNGs | | cacheTtlMs | number | 300000 (5 min) | In-memory cache lifetime; 0 disables caching | | fetchImpl | typeof fetch | global fetch | Custom fetch (e.g. for Node <18 or tests) | | requestInit | RequestInit | {} | Extra options (headers, etc.) applied to every request |

afreum.tokens

| Method | Returns | |---|---| | .all() | All Afreum-native tokens (flexible + fiat) | | .flexible() | Flexible market-priced tokens | | .stable() | Fiat-pegged stable tokens | | .other() | Other supported Stellar assets | | .external() | External crypto assets (BTC, ETH, ...) | | .findBySymbol(symbol) | Single token by symbol, or undefined | | .africanTokens() | Tokens where is_africa === "1" | | .activeTokens() | Tokens where active === "1" |

afreum.geo

| Method | Returns | |---|---| | .regions() | World regions | | .subregions() | World sub-regions | | .countries() | All countries | | .provinces() | All provinces/states | | .cities() | Full city list (~50MB — prefer citiesByProvince) | | .citiesByProvince(provinceId) | Cities for one province only | | .findCountryByIso(code) | Country by ISO2 or ISO3 code | | .africanCountries() | Countries where is_africa === "1" |

afreum.logos

| Method | Returns | |---|---| | .afreumTokenUrl(symbol) | Logo URL for an Afreum-native token | | .tokenUrl(symbol) | Logo URL for any other supported token | | .urlFor(symbol, isAfreumNative) | Picks the right URL builder for you |

afreum.clearCache()

Clears all cached responses immediately.

Data notes (inherited from Afreum's source data)

  • Country and province lists are not filtered for sanctioned countries — apply your own compliance/sanctions filters before using this data in production.
  • The full geo.cities() payload is large (~50MB). Use geo.citiesByProvince(provinceId) whenever you can scope to a known province.
  • External token entries (tokens.external()) currently omit contract address/network fields — verify those independently rather than relying on this dataset.

Development

npm install
npm run build      # compiles src/ -> dist/ with tsc
npm test           # builds, then runs the Node test-runner suite
npm run typecheck  # tsc --noEmit

License

MIT for this SDK's source code. The underlying Afreum JSON data is published by Afreum under GPL-3.0 — see Afreum/json.