1.0.2 • Published 4 years ago
@mazaryk/wordcount v1.0.2
@mazaryk/wordcount
A simple cli word count tool
Usage
$ wordcount ~/some/file.txtOptions
$ wordcount --help
Usage: wordcount [options] <file>
Count word frequency in an input file
Arguments:
file The file to parse
Options:
-v, --version output the version number
-c, --case-sensitive case-sensitive word compare (default: false)
-h, --help display help for commandInstallation
1) Use npm/yarn To Install Globally
Assuming you have nodejs installed, you can install the cli globally:
$ yarn global add @mazaryk/wordcount$ npm i -g @mazaryk/wordcount2) Build From Source
If you would like to build from source, you can clone the git repo, build, optionally run tests, and finally link the 'binary' in your PATH.
$ git clone https://github.com/Mazaryk/wordcount.git
...
$ cd wordcount
$ yarn install
...
$ yarn run build
...
$ yarn run test
...
$ yarn run linkAfter linking, the wordcount cli should be available in a new terminal.
If preferred, once the project has been built, you can skip the linking step and run the script directly with node:
$ node bin/index.js ./test/.mock_data/input.txtRemoving/Unlinking
If you installed globally you can remove the cli:
$ yarn global remove @mazaryk/wordcount$ npm uninstall -g @mazaryk/wordcountIf you built from source and linked, you can remove wordcount from your path by unlinking:
$ yarn run unlinkAssumptions
- Words are counted in a case-insensitive manner by default. (use -c to make it case-sensitive)
- Output is sorted by count. Matching counts are sorted alphabetically.