2.1.1 • Published 9 years ago

resin-device-path v2.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

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

ParamTypeDescription
definitionStringpartition 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

ParamTypeDescription
definitionStringpath 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.

2.1.1

9 years ago

2.1.0

9 years ago

2.0.0

9 years ago

1.0.0

9 years ago