🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

cp-mux

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cp-mux

copy files over a multiplexed stream

latest
Source
npmnpm
Version
1.2.0
Version published
Weekly downloads
4
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

SYOPSIS

a proof of concept to copy files over a multiplexed stream. not feature complete.

EXAMPLE

An example using the net module.

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.

FAQs

Package last updated on 17 Mar 2015

Did you know?

Socket

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.

Install

Related posts