This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

resin-device-path

2.1.1 • Public • Published

resin-device-path

npm version dependencies Build Status Build status

Parse Resin.io device and partition paths.

Role

The intention of this module is to provide low level access to how a Resin.io device and partition paths, used internally in device specifications, are parsed.

THIS MODULE IS LOW LEVEL AND IS NOT MEANT TO BE USED BY END USERS DIRECTLY.

Installation

Install resin-device-path by running:

$ npm install --save resin-device-path

Documentation

devicePath.parsePartition(definition) ⇒ Object

Kind: static method of devicePath
Summary: Parse a partition definition
Returns: Object - parsed partition definition
Throws:

  • Will throw if partition definition is invalid.

Access: public

Param Type Description
definition String partition definition

Example

devicePath.parsePartition('(4:1)')
{
    primary: 4,
    logical: 1
}

devicePath.parsePath(definition) ⇒ Object

Kind: static method of devicePath
Summary: Parse a path definition
Returns: Object - parsed path definition
Throws:

  • Will throw if path definition is invalid.

Access: public

Param Type Description
definition String path definition

Example

devicePath.parsePath('/foo/bar.img(4:1):/baz/qux')
{
    input: {
        path: '/foo/bar.img',
        type: 'image'
    },
    partition: {
        primary: 4,
        logical: 1
    },
    file: '/baz/qux'
}

Support

If you're having any problem, please raise an issue on GitHub and the Resin.io team will be happy to help.

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

License

The project is licensed under the MIT license.

Package Sidebar

Install

npm i resin-device-path

Weekly Downloads

1

Version

2.1.1

License

MIT

Last publish

Collaborators

  • balena.io