2019-08-27 21:11:49 +00:00
|
|
|
'use strict'
|
2019-08-27 18:17:33 +00:00
|
|
|
|
2019-08-27 21:11:49 +00:00
|
|
|
const os = require('os')
|
|
|
|
const path = require('path')
|
|
|
|
const uuid = require('uuid')
|
2019-08-27 18:17:33 +00:00
|
|
|
|
2019-08-27 21:11:49 +00:00
|
|
|
function getSock () {
|
2019-08-27 18:17:33 +00:00
|
|
|
if (process.platform === 'win32') {
|
2019-08-27 21:11:49 +00:00
|
|
|
return '\\\\.\\pipe\\' + uuid()
|
2019-08-27 18:17:33 +00:00
|
|
|
} else {
|
2019-08-27 21:11:49 +00:00
|
|
|
return path.join(os.tmpdir(), uuid())
|
2019-08-27 18:17:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
getSock
|
|
|
|
}
|