Comparing version 0.0.1 to 0.1.0
@@ -60,3 +60,4 @@ import gulp from 'gulp'; | ||
function build() { | ||
return gulp.src(path.join('src', config.entryFileName + '.js')) | ||
return gulp.src(path.join('src', config.entryFileName)) | ||
// return gulp.src('./src/idle.js') | ||
.pipe($.plumber()) | ||
@@ -115,7 +116,7 @@ .pipe(webpackStream({ | ||
const watchFiles = ['src/**/*', 'test/**/*', 'package.json', '**/.eslintrc', '.jscsrc']; | ||
const watchFiles = ['src/**/*', 'example/**/*', 'package.json', '**/.eslintrc', '.jscsrc']; | ||
// Run the headless unit tests as you make changes. | ||
function watch() { | ||
gulp.watch(watchFiles, ['test']); | ||
gulp.watch(watchFiles, ['example']); | ||
} | ||
@@ -122,0 +123,0 @@ |
{ | ||
"name": "idle-js", | ||
"version": "0.0.1", | ||
"description": "Get bus", | ||
"main": "dist/Idle.js", | ||
"version": "0.1.0", | ||
"description": "Detect user idleness", | ||
"main": "dist/idle.js", | ||
"scripts": { | ||
@@ -16,3 +16,3 @@ "test": "gulp", | ||
"type": "git", | ||
"url": "https://github.com/soixantecircuits/Idle.js" | ||
"url": "https://github.com/soixantecircuits/idle-js" | ||
}, | ||
@@ -23,5 +23,5 @@ "keywords": [], | ||
"bugs": { | ||
"url": "https://github.com/soixantecircuits/Idle.js/issues" | ||
"url": "https://github.com/soixantecircuits/idle-js/issues" | ||
}, | ||
"homepage": "https://github.com/soixantecircuits/Idle.js", | ||
"homepage": "https://github.com/soixantecircuits/idle-js", | ||
"contributors": [ | ||
@@ -33,6 +33,6 @@ "massambadiouf <mass@soixantecircuits.fr> (https://github.com/massambadiouf)", | ||
"devDependencies": { | ||
"babel": "^6.3.26", | ||
"babel-core": "^6.4.5", | ||
"babel-eslint": "^4.1.6", | ||
"babel-loader": "^6.2.0", | ||
"babel-plugin-transform-object-assign": "^6.3.13", | ||
"babel-polyfill": "^6.3.14", | ||
@@ -68,5 +68,5 @@ "babel-preset-es2015": "^6.3.13", | ||
"babelBoilerplateOptions": { | ||
"entryFileName": "Idle.js", | ||
"entryFileName": "idle.js", | ||
"mainVarName": "IdleJs" | ||
} | ||
} |
# idle-js | ||
Get bus | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) | ||
# Testing | ||
Webpack: | ||
1. Run the command webpack ./test/entry.js ./test/bundle.js. | ||
2. Open ./test/index.html in your browser. | ||
`npm install idle-js --save` | ||
In browser: | ||
1. Open ./test/vanilla.idle.html | ||
## Usage | ||
```js | ||
// Those are the default values | ||
var idle = new idleJs({ | ||
idle: 10000, // idle time in ms | ||
events: ['mousemove', 'keydown', 'mousedown', 'touchstart'], // events that will trigger the idle resetter | ||
onIdle: function () {}, // callback function to be executed after idle time | ||
onActive: function () {}, // callback function to be executed after back form idleness | ||
onHide: function () {}, // callback function to be executed when window become hidden | ||
onShow: function () {}, // callback function to be executed when window become visible | ||
keepTracking: true, // set it to false of you want to track only once | ||
startAtIdle: false // set it to true if you want to start in the idle state | ||
}).start(); | ||
``` | ||
## Running examples | ||
#### Webpack: | ||
* Run the command `webpack ./example/webpack/entry.js ./example/webpack/bundle.js`. | ||
* Open `./example/webpack/index.html` in your browser. | ||
#### In browser: | ||
* Open `./example/vanilla/index.html` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54762
25
633
32
2