npm.io
1.0.0 • Published 5 years agoCLI

@roland1993/sum-file

Licence
ISC
Version
1.0.0
Deps
1
Size
6 kB
Vulns
0
Weekly
0

sumfile

Introduction

A simple tool to output the sum of numbers located in a file line by line

Installation

npm install -g @roland1993/sum-file
Usage with example

Say you have 3 files:

A.txt:

3
19
B.txt
50

B.txt:

C.txt
27

C.txt:

10
2

Then in your terminal you run sumfile A.txt

The output of the command above will be:

A.txt - 111
B.txt - 39
C.txt - 12
Downloading and running it with node
  1. Download the source code
  2. Open the terminal in the project's root
  3. Run npm install
  4. Run node -r esm src path/to/a/file

For example:

node -r esm src C:/Users/username/Desktop/TEST/a.txt

Keywords