mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-28 12:01:37 -04:00
Add n/prefer-node-protocol rule and autofix all bare builtin imports to use the node: prefix. Simplify the simple-import-sort builtins pattern to just ^node: since all imports now use the prefix.
13 lines
419 B
TypeScript
13 lines
419 B
TypeScript
import fs from 'node:fs'
|
|
import path from 'node:path'
|
|
|
|
import { findMetadataFiles } from './cacheList.js'
|
|
|
|
export async function cacheDelete (opts: { cacheDir: string, registry?: string }, filter: string[]): Promise<string> {
|
|
const metaFiles = await findMetadataFiles(opts, filter)
|
|
for (const metaFile of metaFiles) {
|
|
fs.unlinkSync(path.join(opts.cacheDir, metaFile))
|
|
}
|
|
return metaFiles.sort().join('\n')
|
|
}
|