index.js
function checkWin32(directoryPath) {
  if (directoryPath.charAt(1) !== ':') {
    return new Promise((resolve, reject) => {
      reject(new InvalidPathError(`The following path is invalid (should be X:\\...): ${directoryPath}`))
    })
  }

  return check(
    `wmic logicaldisk get size,freespace,caption`,
    driveData => {
      // Only get the drive which match the path
      const driveLetter = driveData[0]
      return directoryPath.startsWith(driveLetter)
    },
    {
      diskPath: 0,
      free: 1,
      size: 2
    }
  )
}
function checkWin32(directoryPath) {
  if (directoryPath.charAt(1) !== ':') {
    return new Promise((resolve, reject) => {
      reject(new InvalidPathError(`The following path is invalid (should be X:\\...): ${directoryPath}`))
    })
  }

  return check(
    `wmic logicaldisk get size,freespace,caption`,
    driveData => {
      // Only get the drive which match the path
      const driveLetter = driveData[0]
      return directoryPath.startsWith(driveLetter)
    },
    {
      diskPath: 0,
      free: 1,
      size: 2
    }
  )
}
function checkWin32 ( directoryPath ) { if ( directoryPath . charAt ( 1 ) !== ':' ) { return new Promise ( ( resolve , reject ) => { reject ( new InvalidPathError ( ` \\ ${ directoryPath } ` ) ) } ) } return check ( ` ` , driveData => { // Only get the drive which match the path const driveLetter = driveData [ 0 ] return directoryPath . startsWith ( driveLetter ) } , { diskPath : 0 , free : 1 , size : 2 } ) }
Build the check call for win32

@param {String} directoryPath - The file/folder path from where we want to know disk space
@return {Promise} -
Build the check call for win32