mkiso
Utility for creating ISO 9660 images
This library uses adapters built on burning command-line tools to generate ISO 9660 images from a source directory. In order to be able to use this module, make sure you have mkisofs installed on your linux system or hdiutil on your darwin system. It is also possible to use a custom adapter.
Installation
yarn add mkisonpm i mkiso
Usage
The mkiso module returns a constructor that you can use to instanciate commands.
; ;
The following methods are available. Each of these methods can be apply before the exec()
command.
label(name): set the volume name
mkisoinputDirectory: string.label'my volume';
publisher(name): set the publisher name
mkisoinputDirectory: string.publisher'Han Solo';
verbose(): enable the verbose mode
mkisoinputDirectory: string.verbose;
output(target): set the iso output file path
mkiso will default to saving output image to the parent folder of input directory.
mkisoinputDirectory: string.output'/path/to/image.iso';
adapter(adapter): Override the default adapter with a custom one
You can use an existing adapter into the adapters folder or link an external one.
mkisoinputDirectory: string.adapter'mkisofs' | '/path/to/my/adapter';
exec(): start processing
This method must be called as a last instruction. Return a promise containing the stdout and the stderr
.label'my volume' .publisher'Han Solo' .output'/path/to/image.iso' .exec;
Setting event handlers
You can set event listeners for listening the process events. The following events are available:
'progress': stdout of process
'stderr': stderr of process
ChildProcess.error
'error':ChildProcess.close
'close': .output'/path/to/image.iso' .verbose .on'error', console.error'Error:', err .on'progress', console.log'onProgress:', msg .on'close',console.log'onClose:', code, signal .exec;