Socket
Socket
Sign inDemoInstall

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


Version published
Weekly downloads
1.4M
increased by6.79%
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

FAQs

Package last updated on 11 Jun 2016

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