@gik/tools-streamer 0.0.11
RXjs extra operators. Part of our tools suite.
Contributors
Supported platforms
- darwin
- linux
Table of contents
-
streamer An utility belt for our most common operations with RXJS's Observables.
-
fromAccess
member
Determine if given path is accessible. -
fromStat
member
Determine statistics about a file system node. -
fromSpawn
member
Spawn a shell command. -
fromDirMake
member
Creates a directory. -
fromDirRequire
member
Requires a directory path, if the directory does not exists, it's created. -
fromDirRead
member
Get path of nodes in given directory (non recursively). -
fromDirReadRecursive
member
Get path of nodes in given directory (recursively). -
fromFileRead
member
Reads a file from the disk. -
fromFileWrite
member
Writes a file on the disk.
-
fromAccess
streamer
An utility belt for our most common operations with RXJS's Observables.
To do
- [ ] Add unit tests for all operators.
Members
- fromAccess
- fromStat
- fromSpawn
- fromDirMake
- fromDirRequire
- fromDirRead
- fromDirReadRecursive
- fromFileRead
- fromFileWrite
fromAccess
static property of
streamer
Determine if given path is accessible.
Parameters
path
|
string | A path to the node you want to check. |
Returns
StreamBoolean
- Wether the file is accessible or not.
fromStat
static property of
streamer
Determine statistics about a file system node.
Parameters
path
|
string | A path to the node you want to check. |
Returns
StreamStat
- stat object for the node.
Throws
-
Error
- When given an invalid node.
fromSpawn
static property of
streamer
Spawn a shell command.
Parameters
command
|
string | The command you wish to spawn. |
config
|
Object | Configs sent to spawn command. |
Returns
StreamOutput
- Each chunk of either stdout or stderr data.
fromDirMake
static property of
streamer
Creates a directory.
Parameters
path
|
string | The directory to be created. |
Returns
StreamString
- The path of the directory that was just created.
Throws
-
Error
- When directory cannot be created.
fromDirRequire
static property of
streamer
Requires a directory path, if the directory does not exists, it's created.
Parameters
dirpath
|
string | The requested directory. |
Returns
Array.<StreamString>
- The path of the directory.
Throws
-
Error
- When requested path exists and is not a directory.
fromDirRead
static property of
streamer
Get path of nodes in given directory (non recursively).
Parameters
path
|
string | The requested directory. |
Returns
Array.<StreamDirNode>
- The path of the directory.
Throws
-
Error
- When requested path exists and is not a directory.
fromDirReadRecursive
static property of
streamer
Get path of nodes in given directory (recursively).
Parameters
path
|
string | The requested directory. |
Returns
StreamPath
- The path of the directory.
Throws
-
Error
- When requested path exists and is not a directory.
fromFileRead
static property of
streamer
Reads a file from the disk.
Parameters
path
|
string | The path to the file to read. |
Returns
Observable.<string>
- The contents of the file.
fromFileWrite
static property of
streamer
Writes a file on the disk.
Parameters
path
|
string | The full path for the file. |
content
|
string | The contents of the file. |
Returns
Observable.<string>
- The future value true
if write was succesful.
Throws
-
Error
- When the file cannot be written.
Types
Members
NodeOutput
static typedef of
Types
Properties
type
|
string | The type of chunk that is being received. (stderr || stdout) |
data
|
string | The actual output. |
NodePath
static typedef of
Types
Properties
path
|
string | The full path for the node |
data
|
NodeStat | The actual output. |
StreamBoolean
static typedef of
Types
StreamString
static typedef of
Types
StreamStat
static typedef of
Types
A stream containing stat from node.
StreamOutput
static typedef of
Types
A stream containing stat from node.
StreamPath
static typedef of
Types
A stream containing stat from node.
StreamParamError
static typedef of
Types
Thrown when a parameter is not the correct type.