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

timemachine

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

timemachine

Test your time critical app by overriding the native Javascript Date function

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26K
decreased by-13.68%
Maintainers
2
Weekly downloads
 
Created
Source

timemachine Build Status

Test your time-dependent app by monkey patching the Date function and overriding your system time. Timemachine is compatible with global namespaces, RequireJS, CommonJS and NodeJS.

Installation

Bower

$ bower install timemachine

NPM

$ npm install timemachine

Usage

Config

timemachine.config({
  dateString: 'December 25, 1991 13:12:59'
});

console.log(new Date()); // December 25, 1991 13:12:59
ParameterDescriptionDefault
dateStringDate you want set as a stringThu, 01 Jan 1970 00:00:00 GMT
timestampDate you want set as a timestamp0
differenceTime offset in milliseconds0
tickWhether the system clock should continue tickingfalse
keepTimeWhether the system time should be keptfalse

Reset

timemachine.reset();
console.log(new Date()); // Your real system time

Keywords

FAQs

Package last updated on 15 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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