MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / createTemporaryFile

Function createTemporaryFile

src/test/common.node.ts:210–220  ·  view source on GitHub ↗
(options: {
            contents?: string;
            extension: string;
        })

Source from the content-addressed store, hash-verified

208
209 initializeCommonApi({
210 async createTemporaryFile(options: {
211 contents?: string;
212 extension: string;
213 }): Promise<{ file: Uri } & IDisposable> {
214 const extension = options.extension || '.py';
215 const tempFile = tmp.tmpNameSync({ postfix: extension });
216 if (options.contents) {
217 await fs.writeFile(tempFile, options.contents);
218 }
219 return { file: Uri.file(tempFile), dispose: () => swallowExceptions(() => fs.unlinkSync(tempFile)) };
220 },
221 async startJupyterServer(
222 options: {
223 token?: string;

Callers

nothing calls this directly

Calls 3

swallowExceptionsFunction · 0.90
writeFileMethod · 0.65
fileMethod · 0.45

Tested by

no test coverage detected