MCPcopy Index your code
hub / github.com/Kong/insomnia / readFile

Method readFile

packages/insomnia/src/sync/git/mem-client.ts:91–110  ·  view source on GitHub ↗
(filePath: string, options: BufferEncoding | { encoding?: BufferEncoding } = {})

Source from the content-addressed store, hash-verified

89 }
90
91 async readFile(filePath: string, options: BufferEncoding | { encoding?: BufferEncoding } = {}) {
92 filePath = path.normalize(filePath);
93
94 if (typeof options === 'string') {
95 options = {
96 encoding: options,
97 };
98 }
99
100 const encoding = options ? options.encoding : null;
101
102 const entry = this._assertFile(filePath);
103
104 const raw = Buffer.from(entry.contents, 'base64');
105
106 if (encoding) {
107 return raw.toString(encoding);
108 }
109 return raw;
110 }
111
112 async writeFile(
113 filePath: string,

Callers 15

getResponseTimelineFunction · 0.45
getResponseBodyBufferFunction · 0.45
goFunction · 0.45
readAndInsertDocFunction · 0.45
insomniaAdapterFunction · 0.45
secureReadFileFunction · 0.45
insecureReadFileFunction · 0.45
isInsomniaFileFunction · 0.45
initGitRepoCloneActionFunction · 0.45

Calls 3

_assertFileMethod · 0.95
normalizeMethod · 0.80
toStringMethod · 0.45

Tested by 1

gitRepoMirrorPathFunction · 0.36