0.0.4 • Published 1 year ago

@phatpham9/crypto-portfolio-cli v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Features

  • Read transactions data from comma-separated CSV file
  • Fetch token price in USD from cryptocompare.com
  • Calculate portfolio value of a single or multiple tokens
  • Calculate portfolio value on a specific date in the history

Techstack

Install

# run directly via npx
npx @phatpham9/crypto-portfolio-cli

# install as global module
npm install --global @phatpham9/crypto-portfolio-cli

Usage

The CLI fetches price from cryptocompare.com. Please create an account and get your API key prior

# export cryptocompare API key
export CRYPTO_COMPARE_API_KEY=xxx

# read transactions data CSV file. by default it will look for ./data.csv in your current working directory
portfolio -f /path/to/csv/file

# portfolio of all tokens
portfolio

# portfolio of a BTC token
portfolio BTC

# portfolio of all tokens on 2023-01-01
portfolio -d 2023-01-01

# portfolio of a BTC token on 2023-01-01
portfolio -d 2023-01-01 BTC

# show help
portfolio -h

Develop

Clone the repo in your local development, navigate to the project and run the following commands

# watch & rebuild changes
npm run build -- --watch

# run a command. e.g. show help
npm run start -- --help

# run test suite
npm run test

# lint code style
npm run lint

# lint & fix code style
npm run lint:fix

# release version
npm run release:as 1.0.0

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Authors

Phat Pham

License

MIT