last-run

WebJar for last-run

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

last-run
Последняя версия

Последняя версия

1.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

last-run
WebJar for last-run
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/gulpjs/last-run

Скачать last-run

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/last-run/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>last-run</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/last-run/
implementation 'org.webjars.npm:last-run:1.1.1'
// https://jarcasting.com/artifacts/org.webjars.npm/last-run/
implementation ("org.webjars.npm:last-run:1.1.1")
'org.webjars.npm:last-run:jar:1.1.1'
<dependency org="org.webjars.npm" name="last-run" rev="1.1.1">
  <artifact name="last-run" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='last-run', version='1.1.1')
)
libraryDependencies += "org.webjars.npm" % "last-run" % "1.1.1"
[org.webjars.npm/last-run "1.1.1"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.npm : default-resolution jar [2.0.0,3)
org.webjars.npm : es6-weak-map jar [2.0.1,3)

Модули Проекта

Данный проект не имеет модулей.

last-run

NPM version Downloads Build Status AppVeyor Build Status Coveralls Status Gitter chat

Capture and retrieve the last time a function was run.

Usage

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

API

Note: this module uses a WeakMap shim, and throws on non-extensible functions on platforms that don't have a native WeakMap implementation

lastRun(fn, [timeResolution]) => [Timestamp]

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.

lastRun.capture(fn, [timestamp])

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.

lastRun.release(fn)

Takes a function (fn) and removes the last run timestamp for it.

License

MIT

org.webjars.npm

gulp

A toolkit to automate & enhance your workflow

Версии библиотеки

Версия
1.1.1