Configure custom caching with IPCache
masterThe library uses an LRU cache by default (5000 items, 1 day TTL). You can provide your own caching implementation by implementing the IPCache interface and passing it to the constructor.
const { IPinfoWrapper, LruCache } = require("node-ipinfo");
const cacheOptions = {
max: 5000,
ttl: 24 * 1000 * 60 * 60
};
const cache = new LruCache(cacheOptions);
const ipinfoWrapper = new IPinfoWrapper("MY_TOKEN", cache);