0.1.6 • Published 3 years ago

human-delay v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Action Humanization

Execute actions with random, human-like delays. For cases when you need to simulate human behavior. Assumes a Poisson random process with a low intensity to simulate random yet believable arrival times.

Example 1

import { Behavior } from 'human-delay'

const casual = Behavior.casualCasey()

while (true) {
  await casual.do(() => {
    // Casually repeat the same action
  })  
}

Example 2

The do(...) method is variadic, so that all actions supplied to it are queued up sequentially with random humanized delays between them.

import { Behavior } from 'human-delay'

const casey = Behavior.casualCasey()

await casey.do(
  () => { one() },
  () => { two() },
  () => { three() }
)

Default Behaviors

import { Behavior } from 'human-delay'

const
  lucy = Behavior.lethargicLucy(),      // very low intensity arrival times
  taniya = Behavior.thoughtfulTaniya(), // slow arrival times
  casey = Behavior.casualCasey(),       // casual, unfocused user behavior
  steve = Behavior.speedySteve(),       // impatient behavior
  ivan = Behavior.insaneIvan()          // very high intensity behavior
0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago