0.0.14 • Published 11 months ago

get-file-details v0.0.14

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

get-file-details

A Node.js function which gathers basic details about a local file synchronously.

Installation

npm i get-file-details --save

Usage

import { getAllFileDetails, getFileDetails } from "get-file-details";

const detailsForOneFile = getFileDetails('path/to/your/file');
const detailsForManyFile = getAllFileDetails('path/to/your/directory');

File Detail

This function queries and returns the most basic essential properties for querying and manipulating files. The naming convention used was inspired by this Stackoverflow answer.

export interface FileDetail {
  /** The file name without an extension */
  fileRoot: string;
  /** The file name including its extension */
  fileName: string;
  /** The file extension including the preceeding dot */
  fileExtension: string;
  /** The directory path, excluding the filename */
  directory: string;
  /** The full path to the file, including the directory, filename, and extension */
  absolutePath: string;
  /** The file's size in megabytes */
  fileSizeInMb: number;
  /** The file's size in bytes */
  fileSizeInBytes: number;
  /** The last modified date represented as the number of milliseconds since the Unix Epoch */
  lastModifiedTimestampInMs: number;
  /** The last modified date represented in simplified ISO 8601 format */
  lastModifiedISODateString: string;
}
0.0.11

11 months ago

0.0.12

11 months ago

0.0.13

11 months ago

0.0.14

11 months ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago