1.0.5 • Published 6 years ago

file-chopper v1.0.5

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

file-chopper

chopper split and merge files in multiple parts.

Installation

To Install Globally

npm i -g file-chopper --save

To Install Locally

npm i file-chopper --save

Up To Date

All methods support latest Promise feature of ECMAScript Using BlueBird Promise Library.

Split files with input parts

file-chopper(file) => Promise<string[]> 

string[] is an array containing names of all partition files.

Input:

  • file: Path to the file to split.
  • Int: No of files to create from original file

Returns:

  • Promise<string[]>: Promise with string[] array containing full paths of all created files.

Example:

const file-chopper = require('file-chopper');

file-chopper.splitFile(__dirname + '/fileName', Integer)
  .then((names) => {
    console.log(names);
  })
  .catch((err) => {
    console.log('Error: ', err);
  });

Merge parts

mergeFiles(names, outputFile) => Promise<>

Inputs:

  • names: String[] array with full part paths.
  • outputFile: Full path of the output file to be created.

Returns:

  • Promise<>: Promise that results in an empty resolving.

Example:

const file-chopper = require('file-chopper');

file-chopper.mergeFiles(names, __dirname + '/testfile-output.bin')
  .then(() => {
    console.log('Done!');
  })
  .catch((err) => {
    console.log('Error: ', err);
  });
1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago