Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heapwolf/cp-mux
copy files over a multiplexed stream
https://github.com/heapwolf/cp-mux
Last synced: 25 days ago
JSON representation
copy files over a multiplexed stream
- Host: GitHub
- URL: https://github.com/heapwolf/cp-mux
- Owner: heapwolf
- Created: 2015-03-07T17:55:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-17T13:01:33.000Z (over 9 years ago)
- Last Synced: 2024-10-18T16:17:21.122Z (26 days ago)
- Language: JavaScript
- Homepage:
- Size: 236 KB
- Stars: 6
- Watchers: 6
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SYOPSIS
a proof of concept to copy files over a multiplexed stream. not feature complete.# EXAMPLE
An example using the `net` module.```js
var net = require('net')
var cp = require('cp-mux')function onServerReady() {
var socket = net.connect(3000)
var client = cp.createClient('./test/sink')socket.pipe(client)
client.on('end', function() {
process.exit(0)
})
}net
.createServer(cp.createServer('./test/source'))
.listen(3000, onServerReady)
```# OPTIONS
### concurrency
Determines how many files that should be transferred concurrently. Default is `10`.
### force
Specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.### dereference
Makes the cp command follow symbolic links (symlinks) so that the destination has the target file rather than a symlink to the target.### interactive
A callback that provides the name of a file to be overwritten as the first parameter. This occurs if the `TargetDirectory` or `TargetFile` parameter contains a file with the same name as a file specified in the `SourceFile` or `SourceDirectory` parameter. If you call back with `true`, `false` prevents overwriting the file.### preserve
The perserve flag preserves the following characteristics of each source path in the corresponding target: The time of the last data modification and the time of the last access, the ownership (only if it has permissions to do this), and the file permission bits.### recursive
Copy directories recursively.