New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-file-inspector

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-file-inspector

A lightweight Node.js utility to analyze files — get readable size, MIME type, and metadata with timestamps.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

📂 File Inspector

A lightweight node js utility to analyze files - get readable size , MIME type , and also can get the meta data of file along with timestamps easily.

✨ Features

  • 🔍 Analyze files with a single function.
  • 📏 Convert byte size into human-readable format.
  • 🧠 Get MIME types from file extensions.
  • 🕒 Access file creation, modification, and access dates.

📦 Installation

npm install file-inspector  

Usage


import { getReadableSize, getMimeType, analyzeFile } from 'node-file-inspector';

const filepath = "path/to/your/file.js";
const bytes = 2048;

const info = analyzeFile(filepath); // returns metadata object
const fileType = getMimeType(filepath); // returns MIME type
const fileSize = getReadableSize(bytes); // returns readable size string

console.log(info);

Example Output

{
  "fileSize": 1512,
  "readableSize": "1.48 KB",
  "extension": "js",
  "mimeTypes": "application/javascript",
  "createdBy": "04/30/2025 12:15:43 GMT+0530 (India Standard Time)",
  "lastModifiedBy": "04/30/2025 12:15:43 GMT+0530 (India Standard Time)"
}


Keywords

file-inspector

FAQs

Package last updated on 01 May 2025

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