Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
resin-image-fs
Advanced tools
Changelog
v6.0.0
Readme
Resin.io image filesystem manipulation utilities.
The intention of this module is to provide low level utilities to Resin.io operating system data partitions.
THIS MODULE IS LOW LEVEL AND IS NOT MEANT TO BE USED BY END USERS DIRECTLY.
Install resin-image-fs
by running:
$ npm install --save resin-image-fs
bluebird.disposer.<fs>
bluebird.disposer.<ReadStream>
Promise
Promise.<String>
Promise
Promise
Promise
Promise.<Array.<String>>
bluebird.disposer.<fs>
Kind: static method of imagefs
Summary: Get a bluebird.disposer of a node fs like interface for a partition
Returns: bluebird.disposer.<fs>
- node fs like interface
Access: public
Param | Type | Description |
---|---|---|
disk | String | filedisk.Disk | path to the image or filedisk.Disk instance |
partition | Number | partition number |
Example
Promise.using imagefs.interact('/foo/bar.img', 5), (fs) ->
fs.readFileAsync('/bar/qux')
.then (contents) ->
console.log(contents)
bluebird.disposer.<ReadStream>
Kind: static method of imagefs
Summary: Get a device file readable stream
Returns: bluebird.disposer.<ReadStream>
- file stream
Access: public
Param | Type | Description |
---|---|---|
definition | Object | device path definition |
definition.image | String | filedisk.Disk | path to the image or filedisk.Disk instance |
[definition.partition] | Number | partition number |
definition.path | String | file path |
Example
disposer = imagefs.read
image: '/foo/bar.img'
partition: 5
path: '/baz/qux'
Promise.using disposer, (stream) ->
out = fs.createWriteStream('/bar/qux')
stream.pipe(out)
utils.waitStream(out)
Promise
Kind: static method of imagefs
Summary: Write a stream to a device file
Access: public
Param | Type | Description |
---|---|---|
definition | Object | device path definition |
definition.image | String | filedisk.Disk | path to the image or filedisk.Disk instance |
[definition.partition] | Number | partition number |
definition.path | String | file path |
stream | ReadStream | contents stream |
Example
imagefs.write
image: '/foo/bar.img'
partition: 2
path: '/baz/qux'
, fs.createReadStream('/baz/qux')
Promise.<String>
Kind: static method of imagefs
Summary: Read a device file
Returns: Promise.<String>
- file text
Access: public
Param | Type | Description |
---|---|---|
definition | Object | device path definition |
definition.image | String | filedisk.Disk | path to the image or filedisk.Disk instance |
[definition.partition] | Number | partition number |
definition.path | String | file path |
Example
imagefs.readFile
image: '/foo/bar.img'
partition: 5
path: '/baz/qux'
.then (contents) ->
console.log(contents)
Promise
Kind: static method of imagefs
Summary: Write a device file
Access: public
Param | Type | Description |
---|---|---|
definition | Object | device path definition |
definition.image | String | filedisk.Disk | path to the image or filedisk.Disk instance |
[definition.partition] | Number | partition number |
definition.path | String | file path |
contents | String | contents string |
Example
imagefs.writeFile
image: '/foo/bar.img'
partition: 2
path: '/baz/qux'
, 'foo bar baz'
Promise
Kind: static method of imagefs
Summary: Copy a device file
Access: public
Param | Type | Description |
---|---|---|
input | Object | input device path definition |
definition.image | String | filedisk.Disk | path to the image or filedisk.Disk instance |
[input.partition] | Number | partition number |
input.path | String | file path |
output | Object | output device path definition |
output.image | String | path to the image |
[output.partition] | Number | partition number |
output.path | String | file path |
Example
imagefs.copy
image: '/foo/bar.img'
partition: 2
path: '/baz/qux'
,
image: '/foo/bar.img'
partition: 5
path: '/baz/hello'
Promise
Kind: static method of imagefs
Summary: Perform search and replacement in a file
Access: public
Param | Type | Description |
---|---|---|
definition | Object | device path definition |
definition.image | String | filedisk.Disk | path to the image or filedisk.Disk instance |
[definition.partition] | Number | partition number |
definition.path | String | file path |
search | String | RegExp | search term |
replace | String | replace value |
Example
imagefs.replace
image: '/foo/bar.img'
partition: 2
path: '/baz/qux'
, 'bar', 'baz'
Promise.<Array.<String>>
Kind: static method of imagefs
Summary: List the contents of a directory
Returns: Promise.<Array.<String>>
- list of files in directory
Access: public
Param | Type | Description |
---|---|---|
definition | Object | device path definition |
definition.image | String | filedisk.Disk | path to the image or filedisk.Disk instance |
[definition.partition] | Number | partition number |
definition.path | String | directory path |
Example
imagefs.listDirectory
image: '/foo/bar.img'
partition: 5
path: '/my/directory'
.then (files) ->
console.log(files)
If you're having any problem, please raise an issue on GitHub and the Resin.io team will be happy to help.
Run the test suite by doing:
$ npm test
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ npm test
The project is licensed under the Apache 2.0 license.
FAQs
Resin.io image filesystem manipulation utilities
The npm package resin-image-fs receives a total of 5 weekly downloads. As such, resin-image-fs popularity was classified as not popular.
We found that resin-image-fs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.