Sha256: b52db8faf177b668f482af7e88b5669b4dd84769a234b19b9b65fc9d96694870
Contents?: true
Size: 638 Bytes
Versions: 33
Compression:
Stored size: 638 Bytes
Contents
const pinflight = require('promise-inflight') const spawn = require('./spawn.js') const LRU = require('lru-cache') const revsCache = new LRU({ max: 100, ttl: 5 * 60 * 1000, }) const linesToRevs = require('./lines-to-revs.js') module.exports = async (repo, opts = {}) => { if (!opts.noGitRevCache) { const cached = revsCache.get(repo) if (cached) { return cached } } return pinflight(`ls-remote:${repo}`, () => spawn(['ls-remote', repo], opts) .then(({ stdout }) => linesToRevs(stdout.trim().split('\n'))) .then(revs => { revsCache.set(repo, revs) return revs }) ) }
Version data entries
33 entries across 33 versions & 1 rubygems