txt-combiner
v1.2.1
Published
Project for summer practice
Downloads
2
Readme
TXT-combiner
Info
TXT Combiner is a program that combines many text files into one. It has useful options for selecting files by the parameters you need.
Installation
npm install txt-combiner
Overview
$ combine --help
Usage: combine [options] <filename> [files...]
The program combines many TXT files into one.
It copies data from files and adds to the file specified by the first parameter.
Arguments:
filename The file to which the data will be added
files Files from which data will be copied
Options:
-V, --version output the version number
-a, --all takes all files in cwd
-e, --extension <string> takes files by extension in cwd
-S, --substring <string> takes files by subname in cwd
-s, --separator <string> separator between data (default: "\n\n\n")
-h, --help display help for command
The program has two parameters. The first parameter is the name of the file in which the data will be written, the second parameter is the files from which the data will be copied. The first parameter is mandatory, after it you can specify any number of files.
Options
The options can be specified in any position (before or after the file name).
- "-a, --all" this option takes all files in current working directory, without arguments.
- "-e, --extension " this option selects files by a specified extension, such as 'txt' or 'md'. This has a mandatory string argument.
- "-S, --substring " 'This option selects files by a substring in the file name. This has a mandatory string argument.
- "-s, --separator " This option changes the separator between the data being appended to the file. It has a mandatory argument as a string. Special characters must be written in quotes. The default separator is '\n\n\n'.
Example of use
Without options
With '-a, --all' option
With '-e, --extension' option
With '-e, --extension' and '-s, --separator' options
With '-a, --all' and '-s, --separator' options
With '-S, --substring ' option
Setup
make setup
Run tests
make test
Run code coverage
make test-coverage