New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

last-run

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

last-run

Capture and retrieve the last time a function was run

0.2.0
Source
npm
Version published
Weekly downloads
1.5M
0.88%
Maintainers
1
Weekly downloads
 
Created

What is last-run?

The 'last-run' npm package is primarily used to record and retrieve the last time a function was executed. This is particularly useful in build tools and task runners where it's important to know when a task was last run to optimize build processes and avoid unnecessary work.

What are last-run's main functionalities?

Recording last execution time

This feature allows you to capture the last time a specific task was executed. In this example, the 'last-run' package is used with Gulp to record the last execution time of 'example' task.

const lastRun = require('last-run');
const gulp = require('gulp');

function exampleTask(done) {
  // task operations
  done();
}

gulp.task('example', exampleTask);
lastRun.capture('example', Date.now());

Retrieving last execution time

This feature enables retrieving the last recorded execution time of a task. Here, the last execution time of the 'example' task is retrieved and logged.

const lastRun = require('last-run');

const lastExecutionTime = lastRun('example');
console.log('The last execution time of the example task was:', lastExecutionTime);

Other packages similar to last-run

Keywords

execution

FAQs

Package last updated on 12 Apr 2015

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