Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 17, 2024 via pnpm

@sinonjs/fake-timers 11.2.2

Fake JavaScript timers
Package summary
Share
0
issues
2
licenses
2
BSD-3-Clause
1
MIT
Package created
4 Feb 2020
Version published
20 Oct 2023
Maintainers
6
Total deps
3
Direct deps
1
License
BSD-3-Clause

Issues

0
This package has no issues

Licenses

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
@sinonjs/commons@3.0.1
@sinonjs/fake-timers@11.2.2

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
type-detect@4.0.8
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of @sinonjs/fake-timers 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@sinonjs/commons3.0.110.39 kBBSD-3-Clause
prod

Visualizations

Frequently Asked Questions

What does @sinonjs/fake-timers do?

@sinonjs/fake-timers is a JavaScript implementation of the timer APIs. It includes setTimeout, clearTimeout, setImmediate, clearImmediate, setInterval, clearInterval, requestAnimationFrame, cancelAnimationFrame, requestIdleCallback, cancelIdleCallback, along with a clock instance that controls the flow of time. The package also provides a Date implementation that gets its time from the clock. It is perfect for situations where you need the semantics of time scheduling, especially in automated tests, but don't want to actually wait. By using this package, you can simulate the passage of time.

How do you use @sinonjs/fake-timers?

Here's an example illustrating how you use @sinonjs/fake-timers:

// Require the package
var FakeTimers = require("@sinonjs/fake-timers");

// Create a new clock
var clock = FakeTimers.createClock();

// Schedule a function on the clock
clock.setTimeout(function () {
    console.log("Function executed after 15 ms");
}, 15);

// Advance the clock
clock.tick(15);

In this example, we first require the @sinonjs/fake-timers package. We then create a new clock and schedule a function to run after 15 milliseconds. Finally, we advance the clock by 15 milliseconds, leading to the execution of the function.

Where are the @sinonjs/fake-timers docs?

Regarding the @sinonjs/fake-timers documentation, you will find a comprehensive API reference directly within the package's README file on the Github repository available at https://github.com/sinonjs/fake-timers. This documentation includes details on how to create a clock, schedule events on it, and control the flow of time. You'll also find information on the various methods available and how to use them.