src/ExiftoolContext.js
function makeTempFile() {
    const n = Math.floor(Math.random() * 100000)
    const tempFile = path.join(os.tmpdir(), `node-exiftool_test_${n}.jpg`)
    return new Promise((resolve, reject) => {
        const rs = fs.createReadStream(jpegFile)
        const ws = fs.createWriteStream(tempFile)
        rs.on('error', reject)
        ws.on('error', reject)
        ws.on('close', () => {
            resolve(tempFile)
        })
        rs.pipe(ws)
    })
}
function makeTempFile() {
    const n = Math.floor(Math.random() * 100000)
    const tempFile = path.join(os.tmpdir(), `node-exiftool_test_${n}.jpg`)
    return new Promise((resolve, reject) => {
        const rs = fs.createReadStream(jpegFile)
        const ws = fs.createWriteStream(tempFile)
        rs.on('error', reject)
        ws.on('error', reject)
        ws.on('close', () => {
            resolve(tempFile)
        })
        rs.pipe(ws)
    })
}
function makeTempFile ( ) { const n = Math . floor ( Math . random ( ) * 100000 ) const tempFile = path . join ( os . tmpdir ( ) , ` ${ n } ` ) return new Promise ( ( resolve , reject ) => { const rs = fs . createReadStream ( jpegFile ) const ws = fs . createWriteStream ( tempFile ) rs . on ( 'error' , reject ) ws . on ( 'error' , reject ) ws . on ( 'close' , ( ) => { resolve ( tempFile ) } ) rs . pipe ( ws ) } ) }
create temp file for writing metadata
create temp file for writing metadata