// @flow import path from 'path'; import os from 'os'; import mkdirp from 'mkdirp'; import fs from 'fs'; const writeProtoFile = async (src: string): Promise => { const root = path.join(os.tmpdir(), 'insomnia-grpc'); mkdirp.sync(root); const p = path.join(root, `${Math.random()}.proto`); await fs.promises.writeFile(p, src); return p; }; export default writeProtoFile;