How to use the move-file function in move-file

To help you get started, we’ve selected a few move-file examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sourcegraph / sourcegraph / lsif / server / src / http-server.ts View on Github external
tempFileWriteStream.on('close', resolve)
                    tempFileWriteStream.on('error', reject)
                })

                // Load a `Database` from the file to check that it's valid.
                await new JsonDatabase().load(tempFile.path, () => noopTransformer)

                // Replace the old LSIF file with the new file.
                try {
                    await fs.mkdir(STORAGE_ROOT)
                } catch (e) {
                    if (e.code !== 'EEXIST') {
                        throw e
                    }
                }
                await moveFile(tempFile.path, diskKey({ repository, commit }))

                // Evict the old `Database` from the LRU cache to cause it to pick up the new LSIF data from disk.
                dbLRU.del(diskKey({ repository, commit }))

                res.send('Upload successful.')
            })

move-file

Move a file - Even works across devices

MIT
Latest version published 1 year ago

Package Health Score

59 / 100
Full package analysis

Popular move-file functions