This package has been deprecated

Author message:

resin-image is deprecated, please use etcher-image-write instead

resin-image

1.1.4 • Public • Published

resin-image

npm version dependencies Build Status Build status

Resin.io image utilities.

Installation

Install resin-image by running:

$ npm install --save resin-image

Documentation

image.write(Object options, Function callback)

Write 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?

String options.device

The device to write the image to. For example /dev/disk2 or \\.\PhysicalDrive1.

String options.image

The path to the *.img file.

Function options.progress(Object state)

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
}

Tests

Run the test suite by doing:

$ gulp test

Contribute

Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:

$ gulp lint

Support

If you're having any problem, please raise an issue on GitHub.

ChangeLog

v1.1.4

  • Unmount device after writing to it for convenience.

v1.1.3

  • Upgrade umount to v1.1.1, which contains fixes for Linux.

v1.1.2

  • Only unmount mounted devices.

v1.1.1

  • Fix improper unmounting of multiple partitions in GNU/Linux.

v1.1.0

  • Add device unmounting functionality.

License

The project is licensed under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i resin-image

Weekly Downloads

1

Version

1.1.4

License

MIT

Last publish

Collaborators

  • balena.io