Skip to content

Commit ec496aa

Browse files
committed
initial bootstraping
0 parents  commit ec496aa

11 files changed

+1023
-0
lines changed

.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
#Temporary data
6+
.tmp
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
13+
# Directory for instrumented libs generated by jscoverage/JSCover
14+
lib-cov
15+
16+
# Coverage directory used by tools like istanbul
17+
coverage
18+
19+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
20+
.grunt
21+
22+
# Compiled binary addons (http://nodejs.org/api/addons.html)
23+
build/Release
24+
25+
# Dependency directory
26+
# Deployed apps should consider commenting this line out:
27+
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
28+
node_modules

.jshintrc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"bitwise": true,
3+
"browser": true,
4+
"camelcase": true,
5+
"curly": true,
6+
"eqeqeq": true,
7+
"esnext": true,
8+
"immed": true,
9+
"latedef": true,
10+
"newcap": true,
11+
"noarg": true,
12+
"node": true,
13+
"proto": true,
14+
"mocha": true,
15+
"quotmark": "single",
16+
"strict": true,
17+
"undef": true,
18+
"unused": true,
19+
"expr": true,
20+
"ignore": true
21+
}

.npmignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
node_modules
2+
ssl
3+
.DS_STORE
4+
*~
5+
.idea
6+
nbproject
7+
test
8+
.git
9+
.gitignore
10+
.tmp
11+
*.swo
12+
*.swp
13+
*.swn
14+
*.swm
15+
*.log
16+
.jshintrc
17+
.editorconfig
18+
docs
19+
doc.html
20+
.travis.yml
21+
Gruntfile.js

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
node_js:
3+
- "0.10"
4+
before_script:
5+
- npm install -g grunt-cli

Gruntfile.js

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
'use strict';
2+
3+
module.exports = function(grunt) {
4+
5+
// add grunt tasks.
6+
grunt.loadNpmTasks('grunt-mocha-test');
7+
grunt.loadNpmTasks('grunt-contrib-jshint');
8+
grunt.loadNpmTasks('grunt-contrib-watch');
9+
10+
grunt.initConfig({
11+
// Configure a mochaTest task
12+
mochaTest: {
13+
test: {
14+
options: {
15+
reporter: 'spec',
16+
timeout: 20000
17+
},
18+
src: ['test/**/*.js']
19+
}
20+
},
21+
jshint: {
22+
options: {
23+
reporter: require('jshint-stylish'),
24+
jshintrc: '.jshintrc'
25+
},
26+
all: [
27+
'Gruntfile.js',
28+
'index.js',
29+
'lib/**/*.js',
30+
'test/**/*.js'
31+
]
32+
},
33+
watch: {
34+
all: {
35+
files: [
36+
'Gruntfile.js',
37+
'index.js',
38+
'lib/**/*.js',
39+
'test/**/*.js'
40+
],
41+
tasks: ['default']
42+
}
43+
}
44+
});
45+
46+
//custom tasks
47+
grunt.registerTask('default', ['jshint', 'mochaTest', 'watch']);
48+
grunt.registerTask('test', ['jshint', 'mochaTest']);
49+
50+
};

README.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# MoneyJS
2+
3+
[![Build Status](https://travis-ci.org/lykmapipo/MoneyJS.svg?branch=master)](https://travis-ci.org/lykmapipo/MoneyJS)
4+
5+
Nodejs library to represent monetary amounts.
6+
7+
## Installation
8+
```sh
9+
$ npm install --save MoneyJS
10+
```
11+
12+
## Usage
13+
```js
14+
var Money = require('MoneyJS');
15+
...
16+
//continue with money usage
17+
...
18+
```
19+
20+
## API
21+
22+
23+
## Testing
24+
* Clone this repository
25+
26+
* Install all development dependencies
27+
```sh
28+
$ npm install
29+
```
30+
31+
* Then run test
32+
```sh
33+
$ npm test
34+
```
35+
36+
37+
## Contribute
38+
It will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas. Do not forget to add a bit of test(s) of what value you adding.
39+
40+
41+
## Licence
42+
The MIT License (MIT)
43+
44+
Copyright (c) 2015 lykmapipo & Contributors
45+
46+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
47+
48+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
49+
50+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

index.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
//dependencies
4+
var path = require('path');
5+
6+
7+
/**
8+
* @description export money type
9+
* @type {Money}
10+
*/
11+
module.exports = require(path.join(__dirname, 'lib', 'money'));

lib/currencies.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
//dependencies
4+
var _ = require('lodash');
5+
6+
/**
7+
* @description store countries currencies details
8+
* @type {Object}
9+
*/
10+
var currencies = {};
11+
12+
//load Currency with all currencies data
13+
_.forEach(require('country-data').currencies.all, function(currency) {
14+
//add currency countries currencies
15+
currencies[currency.code] = currency;
16+
});
17+
18+
/**
19+
* @description export currencies
20+
* @type {Object}
21+
*/
22+
module.exports = currencies;

0 commit comments

Comments
 (0)