Skip to content

Commit 71fb5d7

Browse files
committed
First commit
0 parents commit 71fb5d7

File tree

9 files changed

+118
-0
lines changed

9 files changed

+118
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015"]
3+
}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
.idea
3+
npm-debug.log
4+
coverage
5+
.nyc_output
6+
dist

.npmignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
src
2+
.idea
3+
test
4+
node_modules
5+
.git
6+
npm-debug.log
7+
.travis.yml
8+
coverage
9+
.nyc_output
10+
.babelrc
11+

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
node_js:
3+
- "4"
4+
- "0.10"
5+
notifications:
6+
email: false

gulpfile.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const gulp = require('gulp');
2+
const babel = require('gulp-babel');
3+
4+
gulp.task('src', () => {
5+
return gulp.src(['src/**/*'])
6+
.pipe(babel({
7+
presets: ['es2015']
8+
}))
9+
.pipe(gulp.dest('dist'));
10+
});
11+
12+
gulp.task('default', ['src'] , () => {
13+
gulp.watch('src/**/*', ['src']);
14+
});

package.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "codeforces-api",
3+
"version": "1.0.0",
4+
"description": "Codeforces API Client Library for Node.js",
5+
"main": "dist/index.js",
6+
"scripts": {
7+
"test": "./node_modules/.bin/mocha --compilers js:babel-register \"test/**/*\"",
8+
"coverage": "./node_modules/.bin/nyc npm test"
9+
},
10+
"engine": "node >= 4.0.0",
11+
"author": "Ahmed Dinar <madinar.cse@gmail.com>",
12+
"private": false,
13+
"license": "MIT",
14+
"devDependencies": {
15+
"babel-preset-es2015": "^6.16.0",
16+
"babel-register": "^6.16.0",
17+
"chai": "^3.5.0",
18+
"debug": "^2.2.0",
19+
"gulp": "^3.9.1",
20+
"gulp-babel": "^6.1.2",
21+
"mocha": "^3.1.0",
22+
"nyc": "^8.3.0"
23+
},
24+
"dependencies": {
25+
"crypto-js": "^3.1.6",
26+
"lodash": "^4.16.2",
27+
"moment": "^2.15.1",
28+
"qs": "^6.2.1",
29+
"randomstring": "^1.1.5",
30+
"request": "^2.75.0"
31+
},
32+
"keywords": [
33+
"codeforces",
34+
"codeforces api",
35+
"api",
36+
"client",
37+
"api client"
38+
],
39+
"repository": {
40+
"type": "git",
41+
"url": "git@github.com:ahmed-dinar/codeforces-api-node.git"
42+
},
43+
"contributors": [],
44+
"bugs": {
45+
"url": "https://github.com/ahmed-dinar/codeforces-api-node/issues"
46+
}
47+
}

src/codeforces.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"use strict"
2+
3+
export class Codeforces {
4+
5+
constructor () {
6+
7+
}
8+
9+
add (x=0,y=0) {
10+
return x+y;
11+
}
12+
}

src/index.js

Whitespace-only changes.

test/test-codeforces.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { expect } from 'chai';
2+
import { Codeforces } from '../src/codeforces';
3+
4+
describe('Codeforces', () => {
5+
describe('#add', () => {
6+
7+
let cf;
8+
9+
beforeEach(() => {
10+
cf = new Codeforces();
11+
});
12+
13+
it('returns 3', () => {
14+
let result = cf.add(1,2);
15+
expect(result).to.equal(3);
16+
});
17+
18+
});
19+
});

0 commit comments

Comments
 (0)