Skip to content

nraynaud/xo-vmdk-to-vhd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xo-vmdk-to-vhd

Build Status JS lib streaming a vmdk file to a vhd

To install:

$ npm install xo-vmdk-to-vhd

To convert a VMDK stream to a Fixed VHD stream without buffering the entire input or output:

import convertFromVMDK from 'xo-vmdk-to-vhd'
import {createReadStream, createWriteStream} from 'fs-promise'

const pipe = (await convertFromVMDK(fs.createReadStream(vmdkFileName))).pipe(fs.createWriteStream(vhdFileName))
    await new Promise((resolve, reject) => {
      pipe.on('finish', resolve)
      pipe.on('error', reject)
    })

or:

var converter =  require('xo-vmdk-to-vhd').default;

var fs = require('fs-promise')
var p = converter(fs.createReadStream(vmdkFileName));
p.then(function(stream) {
    var pipe = stream.pipe(fs.createWriteStream(vhdFileName));
    return new Promise(function(resolve, reject) {
        pipe.on('finish', resolve)
      	pipe.on('error', reject)
    });
});

About

JS lib streaming a vmdk file to a vhd

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%