MCPcopy Create free account
hub / github.com/Crain99/cc-reverse / readFile

Function readFile

src/utils/fileManager.js:58–65  ·  view source on GitHub ↗

* 读取文件内容 * @param {string} filePath 文件路径 * @param {string} encoding 编码方式,默认为 utf-8 * @returns {Promise } 文件内容

(filePath, encoding = 'utf-8')

Source from the content-addressed store, hash-verified

56 * @param {any} data 要写入的数据
57 * @returns {Promise<void>}
58 */
59 async writeFile(directory, filename, data) {
60 try {
61 const outputDir = path.join(global.paths.output, 'assets', directory);
62 await this.ensureDirectoryExists(outputDir);
63
64 const outputPath = path.join(outputDir, filename);
65
66 let content;
67 if (typeof data === 'object' && data !== null) {
68 content = safeJsonStringify(data, 2);

Callers 6

jsonToPlistFunction · 0.85
reverseProjectFunction · 0.85
processJsonFilesFunction · 0.85
unpackBundleFunction · 0.85
unpackAssetFunction · 0.85
extractPackSectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected