Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thatisuday/file-checksum

A CLI tool to calculate the checksum of file's content using md5 or sha1 algorithms.
https://github.com/thatisuday/file-checksum

algorithm checksum cli md5 node-cli node-js node-module nodejs sha1

Last synced: 6 days ago
JSON representation

A CLI tool to calculate the checksum of file's content using md5 or sha1 algorithms.

Awesome Lists containing this project

README

        

# File Checksum CLI
A CLI tool to calculate checksum of file's content using **md5** or **sha1** algorithms.

[![build-status](https://img.shields.io/travis/thatisuday/file-checksum?style=flat-square)](https://travis-ci.org/thatisuday/file-checksum)
[![npm-version](https://img.shields.io/npm/v/file-checksum?style=flat-square)](https://www.npmjs.com/package/file-checksum)
[![dependencies](https://img.shields.io/david/thatisuday/file-checksum?style=flat-square)](https://www.npmjs.com/package/file-checksum)
[![downloads](https://img.shields.io/npm/dt/file-checksum?style=flat-square)](https://www.npmjs.com/package/file-checksum)
[![license](https://img.shields.io/npm/l/file-checksum?style=flat-square)](https://www.npmjs.com/package/file-checksum)

![carbon](https://raw.githubusercontent.com/thatisuday/file-checksum/master/res/carbon.now.sh.png)

## Installation
```
$ npm install -g file-checksum
```

## Help and Version
```
$ file-checksum -v
1.0.4

$ file-checksum --help
Calculate checksum of a file.

Usage: file-checksum [options]

Options:
-v, --version Print current CLI version.
-a, --algorithm Algorithm to be used for hashing (md5 or sha1) (default: "md5")
-h, --help output usage information
```

## Calculate Checksum
Once this package is installed globally, you can use `file-checksum` command.
```
$ file-checksum
$ file-checksum -a sha1
$ file-checksum --algorithm sha1
```
> If `-a` or `--algorithm` flag is missing, by default **md5** algorithm is used.

#### Example
```
$ file-checksum test/file.txt

5e7c683623bdabaeae97f8157e80f85c
```

---

To create your own CLI tool using node.js, follow my article on [**Medium**](https://itnext.io/making-cli-app-with-ease-using-commander-js-and-inquirer-js-f3bbd52977ac).