Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

idle-js

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idle-js - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

.npmignore

7

gulpfile.babel.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc