0.0.10 • Published 2 years ago

get-file-details v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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 getFileDetails from 'get-file-details';

const fileDetails = getFileDetails('path/to/your/file');

File Details

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.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago