Skip to content

Commit

Permalink
project refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
BelirafoN authored and BelirafoN committed May 12, 2016
1 parent 3bd6641 commit d060e8e
Show file tree
Hide file tree
Showing 7 changed files with 180 additions and 33 deletions.
112 changes: 91 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,67 @@ coverage
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history
### OSX template
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries
.idea/gradle.xml
.idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml
.idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:
Expand All @@ -75,4 +103,46 @@ atlassian-ide-plugin.xml
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Windows template
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# Archives
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Databases
*.sql
*.sqlite

# OS temp files
.DS_Store*
Icon?

# tmp files & folders
tmp


12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: node_js
node_js:
- "6"
- "5"
- "4"
os:
- linux
- osx
- windows
script: npm run coverage
# Send coverage data to Coveralls
after_script: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Alex Voronyansky

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:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

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.
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
# Throttle Decorator
# Throttle Wrapper

Функиция-декоратор для контроля числа вызовов обернутой функции.
[![Build Status](https://travis-ci.org/BelirafoN/throttle.svg?branch=master)](https://travis-ci.org/BelirafoN/throttle)
[![Coverage Status](https://coveralls.io/repos/BelirafoN/throttle/badge.svg)](https://coveralls.io/r/BelirafoN/throttle)
[![Code Climate](https://codeclimate.com/github/BelirafoN/throttle/badges/gpa.svg)](https://codeclimate.com/github/BelirafoN/throttle)

Function-wrapper to reduce the number of calls the inverse function.

## Install

```bash
$ git clone git@github.com:BelirafoN/throttle.git
```

## Tests

Tests require [Mocha](https://mochajs.org/).

```bash
mocha ./tests
```

or with `npm`

```bash
npm test
```

Test coverage with [Istanbul](https://gotwarlost.github.io/istanbul/)

```bash
npm run coverage
```

## License

Licensed under the MIT License
File renamed without changes.
28 changes: 19 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
{
"name": "throttle",
"version": "0.0.1",
"description": "Функиция-декоратор для контроля числа вызовов обернутой функции.",
"main": "./src/throttle.js",
"directories": {
"test": "tests"
"description": "Function-wrapper to reduce the number of calls the inverse function.",
"engines": {
"node": ">=4.0"
},
"main": "./lib/throttle.js",
"dependencies": {},
"devDependencies": {
"coveralls": "^2.11.9",
"istanbul": "^0.4.3",
"mocha": "^2.4.5"
},
"scripts": {
"test": "mocha ./tests"
"test": "mocha ./test",
"coverage": "istanbul cover _mocha -- -R spec"
},
"repository": {
"type": "git",
"url": "git@git.ditrade.ru:BelirafoN/throttle.git"
"url": "git@github.com:BelirafoN/throttle.git"
},
"devDependencies": {
"mocha": "^2.4.5"
"author": {
"name": "Alex Voronyansky",
"email": "belirafon@gmail.com"
},
"bugs": {
"email": "belirafon@gmail.com"
},
"author": "BelirafoN <belirafon@gmail.com>",
"license": "MIT"
}
2 changes: 1 addition & 1 deletion tests/throttleTest.js → test/throttleTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"use strict";

const assert = require('assert');
const throttle = require('../src/throttle');
const throttle = require('../lib/throttle');

describe('Throttle decorator functionality', () => {
let callCounter = 0,
Expand Down

0 comments on commit d060e8e

Please sign in to comment.