(p: string, c: string)
| 135 | |
| 136 | const read = async (p: string) => fs.readFile(p, 'utf8') |
| 137 | const write = async (p: string, c: string) => { |
| 138 | await fs.mkdir(path.dirname(p), { recursive: true }) |
| 139 | await fs.writeFile(p, c, 'utf8') |
| 140 | } |
| 141 | const exists = async (p: string) => !!(await fs.stat(p).catch(() => false)) |
| 142 | const toPosix = (p: string) => p.split(path.sep).join('/') |
| 143 | const stripExt = (p: string) => p.replace(/\.[^.]+$/, '') |