npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

curry_conv

v1.2.0

Published

A command-line currency converter

Downloads

9

Readme

curry_conv

A Node.js command-line interface app for converting currencies.

To run this tool, you must obtain a key from Open Exchange Rates. This is easy and doesn't require that you give credit card info.

System Requirements

  1. Node.JS
  2. MongoDB
  1. git

Dependencies

For details, see the package.json file.

  • Command line interface is supported by commander and inquirer modules
  • API access depends on the request and dotenv modules
  • Conversion record validation an storage depends on mongoose modules
  • CSV export uses json2csv and Node's Core File System modules
  • Multiple formatting modules were used to improve terminal output readability (columnify, currency-symbol-map, moment, and pluralize)

Installation Steps

  1. Clone the currency converter repo and move into the currency_converter directory.
git clone https://github.com/gingin77/currency_converter.git
cd currency_converter
  1. To access the executable curry command, you'll need to run a global npm install, which may or may not require you to use sudo:
currency_converter $ sudo npm i -g
  1. You should now be able to run curry --help to see a list of options.

  2. Using a browser, sign up for a free account at openexchangerates.org and obtain an API key.

  3. Copy the .env.sample to a new .env file

cp .env.sample .env
  1. Open your .env file and replace the dummy string with the API key obtained from Open Exchange Rates.
# .env
OPEN_EXCHANGE_KEY = 235233_your_actual_key_goes_here_53531513346713476

Options

currency_converter $ curry --help

  Usage: curry [options] [command]

  Options:

    -V, --version   output the version number
    -h, --help      output usage information

  Commands:

    convert         Prompts user to submit currency types and a value to convert
    last-one        Retrieves a record of the last conversion
    last-ten        Retrieves up to 10 of the most recent conversions
    query-currency  Returns up to 10 records for a selected converted-to currency
    csv-export      Allows ALL historical conversions to be exported to a .csv file

Troubleshooting

If you see null after Getting exchange rates.... as shown in the example below, you are not connecting with the Open Exchange Rates API and likely need to add your key to the .env file.

 currency_converter  $ curry convert
? Choose a base currency type to convert from: United States Dollar
? Choose a currency type to convert to: Brazilian Real
? How much do you want to convert? 78900

Getting exchange rates...
null