0.2.0 • Published 12 months ago

@hbauer/time-since-file v0.2.0

Weekly downloads
-
License
-
Repository
github
Last release
12 months ago

@hbauer/time-since-file

Install

$ yarn add @hbauer/time-since-file
$ npm install @hbauer/time-since-file

Usage

import { timeSinceFile } from '@hbauer/time-since-file'

const path = 'path/to/file.ext' // e.g. file created 36 hours ago
const since = await timeSinceFile(path)

assert(since.created.milliseconds === 36 * 60 * 60 * 1000)
assert(since.created.seconds === 36 * 60 * 60)
assert(since.created.minutes === 36 * 60)
assert(since.created.hours === 36)
// etc.
0.2.0

12 months ago

0.1.0

12 months ago