• Stars
    star
    149
  • Rank 240,927 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 10 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Node.js module to work with currency codes based on ISO 4217

currency-codes

A node.js module to list and work on currency codes based on the ISO 4217 standard.

npm install currency-codes

code('EUR')

var cc = require('currency-codes');
console.log(cc.code('EUR'));

/*
{
	code: 'EUR',
	number: 978,
	digits: 2,
	currency: 'Euro',
	countries: [
		'andorra', 'austria', 'belgium', 'cyprus', 'estonia', 'finland',
		'france', 'germany', 'greece', 'ireland', 'italy', 'kosovo',
		'luxembourg', 'malta', 'monaco', 'montenegro', 'netherlands',
		'portugal', 'san marino', 'slovakia', 'slovenia', 'spain',
		'vatican city' ]
}
*/

number(967)

var cc = require('currency-codes');
console.log(cc.number(967));

/*
{
	code: 'ZMW',
	number: 967,
	digits: 2,
	currency: 'Zambian kwacha',
	countries: [ 'zambia' ] }
*/

country('colombia')

var cc = require('currency-codes');
console.log(cc.country('colombia'));

/*
[
	{
		code: 'COP',
		number: 170,
		digits: 2,
		currency: 'Colombian peso',
		countries: [ 'colombia' ]
	}, {
		code: 'COU',
		number: 970,
		digits: 2,
		currency: 'Unidad de Valor Real',
		countries: [ 'colombia' ]
	}
]
*/

codes()

var cc = require('currency-codes');
console.log(cc.codes());

/*
[
	'AED',
	'AFN',
	...
	'ZAR',
	'ZMW'
]
*/

numbers()

var cc = require('currency-codes');
console.log(cc.numbers());

/*
[
	'784',
	'971',
	...
	'710',
	'967'
]
*/

countries()

var cc = require('currency-codes');
console.log(cc.countries());

/*
[ 
	'united arab emirates',
	'afghanistan',
	...
]
*/

data

var data = require('currency-codes/data');
console.log(data);

/*
[{
	code: 'AED',
	number: '784',
	digits: 2,
	currency: 'United Arab Emirates dirham',
	countries: ['united arab emirates']
}, {
	code: 'AFN',
	number: '971',
	digits: 2,
	currency: 'Afghan afghani',
	countries: ['afghanistan']
}, {
	...
*/

publishDate

var cc = require('currency-codes');

console.log(cc.publishDate);

/*
2018-08-29
*/

ISO-4217

Fetch the latest copy of ISO-4217 from the maintainer and update this library's currency data file.

$ npm run iso

> [email protected] iso currency-codes
> npm run iso:fetch-xml && npm run iso:ingest-xml


> [email protected] iso:fetch-xml currency-codes
> node scripts/fetch-iso-4217-xml.js

Downloaded https://www.currency-iso.org/dam/downloads/lists/list_one.xml to iso-4217-list-one.xml

> [email protected] iso:ingest-xml currency-codes
> node scripts/ingest-iso-4217-xml.js

Ingested iso-4217-list-one.xml into data.js
Wrote publish date to iso-4217-publish-date.js

Note: You may have to manually tweak the capitalization of some country's names.

License

MIT

More Repositories

1

progress-stream

Read the progress of a stream
JavaScript
230
star
2

single-line-log

Output one line and move to beginning of line. Useful for progress bars and counters with no breaks in the terminal
JavaScript
209
star
3

create-repository

Automatically creates and sets up a new github repository
JavaScript
62
star
4

redis-eventemitter

Redis pubsub using an event emitter for node.js
JavaScript
30
star
5

mtgtop8

Get events and decks data from mtgtop8.com
JavaScript
29
star
6

dombo

A very thin layer on top of the DOM to make working with the DOM much easier. Also include some extra jquery-like features to work with events and classes.
JavaScript
26
star
7

mtgjson

Node.js module that fetches AllSets.json from http://mtgjson.com and caches it so you are always sure to have the newest version.
JavaScript
15
star
8

github-with-auth

Get started using the github in no time! Instantiates github module by using ghauth.
JavaScript
14
star
9

dependency-hunter

Find node.js dependencies in github repositories
JavaScript
10
star
10

docx-to-pdf

Convert docx files to pdf using http://convertonlinefree.com
JavaScript
9
star
11

tvcom

A simple module for getting data from tv.com
JavaScript
9
star
12

mtgjson-render

Generates images from Magic: The Gathering card data based on the https://github.com/freeall/mtgjson format
JavaScript
9
star
13

trend

Find out how a chart (array of values) are trending. Compares the last X points to the previous Y points before them.
JavaScript
7
star
14

findcoronacenter.dk

Generate map to find corona test centers in Denmark
JavaScript
6
star
15

funcle

"We have the output, you have the input" - the algorithmic jeopardy game
JavaScript
5
star
16

mtg-printer

Nice shell interface for generating images from Magic: The Gathering card data based on the https://github.com/freeall/mtgjson format.
JavaScript
5
star
17

http-monitor

Check if a server is running. Both a module and an executable.
JavaScript
5
star
18

one-year-of-open-source

Celebrate that @mafintosh has a one year streak on Github
HTML
3
star
19

slack-team-watcher

Have all of your teams public chats listed in the CLI
JavaScript
2
star
20

td-combiner

JavaScript
2
star
21

sysinfo-flashy

A flashy sysinfo. Used for when terminal starts, just to be flashy ☯️
JavaScript
2
star
22

think

A small puzzle game
JavaScript
2
star
23

load-environment

Simply load your environment from name-of-your-environment.json. Takes the name from process.env.NODE_ENV.
JavaScript
2
star
24

mtg-aether-revolt

HTML
1
star
25

tower-defense

JavaScript
1
star
26

outdated

A node module that checks if the running process is outdated based on its package.json
JavaScript
1
star
27

flight-mode

Have you ever wanted to point to your screen and tell the flight attendant that "Nono, it really is in flight mode"?
JavaScript
1
star
28

freeall

1
star
29

timer

A timer with a basic web interface
1
star
30

mtg-card-detector

Python
1
star
31

playlister

1
star