resin-device-path
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
- .parsePath(definition) ⇒
Object
- .parsePartition(definition) ⇒
Object
devicePath.parsePartition(definition) ⇒ 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 primary: 4 logical: 1
Object
devicePath.parsePath(definition) ⇒ 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 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
- Issue Tracker: github.com/resin-io/resin-device-path/issues
- Source Code: github.com/resin-io/resin-device-path
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.