![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Capture and retrieve the last time a function was run
var lastRun = require('last-run');
function myFunc(){}
myFunc();
// capture the run after (or before) calling the function
lastRun.capture(myFunc);
// retrieve the last run time
lastRun(myFunc);
//-> outputs the Date.now() when capture was called
Note: this module uses a WeakMap shim, and throws on non-extensible functions on platforms that don't have a native WeakMap implementation
Takes a function (fn
) and returns a timestamp of the last time the function was captured.
Returns undefined if the function has not been captured.
The timestamp is always given in millisecond but the time resolution can be reduced (rounded down).
The use case is to be able to compare a build time to a file time attribute.
On node v0.10 or with file system like HFS or FAT, fs.stat
time attributes like mtime
precision is one second.
Assuming lastRun(fn)
returns 1426000001111, lastRun(fn, 1000)
returns 1426000001000.
The default time resolution is 1000 on node v0.10, 0 on node 0.11+ and iojs.
More information at default-resolution
and
undertaker PR #17.
Takes a function (fn
) and captures the current timestamp with Date.now()
.
If passed the optional timestamp, captures that time instead of Date.now()
.
The captured timestamp can then be retrieved using the lastRun
function.
Takes a function (fn
) and removes the last run timestamp for it.
MIT
FAQs
Capture and retrieve the last time a function was run
The npm package last-run receives a total of 0 weekly downloads. As such, last-run popularity was classified as not popular.
We found that last-run demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.