()
| 46 | } |
| 47 | |
| 48 | export async function dumpCache() { |
| 49 | if (!cacheChanged) |
| 50 | return |
| 51 | try { |
| 52 | await fs.mkdir(cacheDir, { recursive: true }) |
| 53 | await fs.writeFile(cachePath, JSON.stringify(cache), 'utf-8') |
| 54 | debug.cache(`cache saved to ${cachePath}`) |
| 55 | } |
| 56 | catch (err) { |
| 57 | console.warn('Failed to save cache') |
| 58 | console.warn(err) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | export async function getPackageData(name: string, protocol: Protocol = 'npm', cwd?: string): Promise<PackageData> { |
| 63 | let error: any |
no test coverage detected
searching dependent graphs…