GithubHelp home page GithubHelp logo

file-metadata's Introduction

file-metadata

Get file metadata using mdls on macOS

Install

npm install file-metadata

Usage

import {fileMetadata} from 'file-metadata';

console.log(await fileMetadata('index.js'));
/*
{
	contentCreationDate: 2016-10-25T18:25:46.000Z,
	contentCreationDateRanking: 2016-10-25T00:00:00.000Z,
	contentModificationDate: 2017-12-29T19:56:15.000Z,
	contentType: 'com.netscape.javascript-source',
	contentTypeTree: [
		'com.netscape.javascript-source',
		'public.script',
		'public.source-code',
		'public.data',
		'public.plain-text',
		'public.item',
		'com.netscape.javascript-source',
		'public.content',
		'public.executable',
		'public.text'
	],
	dateAdded: 2017-12-29T18:42:39.000Z,
	dateAddedRanking: 2017-12-29T00:00:00.000Z,
	displayName: 'index.js',
	fsContentChangeDate: 2017-12-29T19:56:15.000Z,
	fsCreationDate: 2016-10-25T18:25:46.000Z,
	fsCreatorCode: 0,
	fsFinderFlags: 0,
	fsInvisible: false,
	fsIsExtensionHidden: false,
	fsLabel: 0,
	fsName: 'index.js',
	fsOwnerGroupID: 20,
	fsOwnerUserID: 501,
	fsSize: 860,
	fsTypeCode: 0,
	interestingDateRanking: 2016-10-25T00:00:00.000Z,
	kind: 'JavaScript script',
	lastUsedDate: 2017-12-29T18:42:57.000Z,
	lastUsedDateRanking: 2017-12-29T00:00:00.000Z,
	logicalSize: 860,
	physicalSize: 4096,
	useCount: 1,
	usedDates: [
		2017-12-28T23:00:00.000Z
	]
}
*/

API

fileMetadata(filePath)

Returns a Promise<object> with the properties seen in the above example.

fileMetadataSync(filePath)

Returns an object with the properties seen in the above example.

Related

  • file-uti - Get the UTI (Uniform Type Identifier) of a file on macOS

file-metadata's People

Contributors

sindresorhus avatar richienb avatar

Stargazers

Zack Lieberman avatar Matt Petty avatar Şakir Şensoy avatar Taichi Tsuchida avatar AM avatar Rowanelizabeth avatar eg avatar Rohan avatar Mindula Dilthushan Manamperi avatar Tobias Zittlau avatar Matthew avatar P-Chan avatar Bram Adams avatar Cat  avatar YoungChief avatar 锂碘 avatar Lucas Pultz avatar Dean Lofts avatar Arihant Verma avatar Josef Leyva avatar Brad Reno avatar  avatar 純 avatar color avatar  avatar 51pwn avatar Christopher Anderton avatar Merlijn Vos avatar Nikolaos Kamarinakis avatar Kah Wai Liew avatar Ain Tohvri avatar  avatar jermdw avatar  avatar Emmanuel Haguet avatar netop://wibby avatar Steven avatar streetlamp avatar Teo Bais avatar Monty Anderson avatar Luka Vidaković avatar buzai avatar  avatar Thilo Schmalfuß avatar Patrick Olsen avatar Zhao Lei avatar Denis Denisov avatar Alexey Novikov avatar Hasan Bayat avatar Thibault Maekelbergh avatar 0xairhead avatar Washington Botelho avatar Daniel Bayley avatar

Watchers

 avatar James Cloos avatar  avatar

file-metadata's Issues

Importing the library using require

I'm using Node v16.6.0. I tried importing the library in this way:

const fileMetadata = require("file-metadata");

It returns [ERR_REQUIRE_ESM]. Is there no way to fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.