DEPRECATED in favor of https://github.com/resin-io/resin-image-write
Resin.io image utilities.
Install resin-image by running:
$ npm install --save resin-imageWrite an image to a device.
The callback gets passed a single argument: a possible error.
Notice: You might need admin privileges to run this operation or you might get an EACCES error.
Example:
image = require('resin-image')
image.write {
device: '/dev/disk2'
image: 'path/to/image.img'
progress: (state) ->
console.log(state)
}, (error) ->
throw error if error?The device to write the image to. For example /dev/disk2 or \\.\PhysicalDrive1.
The path to the *.img file.
An optional property that is called each 500ms with state information.
state is an object containing the following properties:
{
percentage: 9.05,
transferred: 949624,
length: 10485760,
remaining: 9536136,
eta: 42,
runtime: 3,
delta: 295396,
speed: 949624
}Run the test suite by doing:
$ gulp test- Issue Tracker: github.com/resin-io/resin-image/issues
- Source Code: github.com/resin-io/resin-image
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ gulp lintIf you're having any problem, please raise an issue on GitHub.
- Unmount device after writing to it for convenience.
- Upgrade
umountto v1.1.1, which contains fixes for Linux.
- Only unmount mounted devices.
- Fix improper unmounting of multiple partitions in GNU/Linux.
- Add device unmounting functionality.
The project is licensed under the MIT license.
