npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mdls

v1.2.0

Published

OSX's mdls from node.

Readme

mdls

OSX's mdls from node.

A thin wrapper around mdls.

You give it a path, it runs mdls and calls a callback with the result.

Install

npm install --save mdls

Usage

Basic example

try {
    const data = await mdls('./index.js');
    console.log('Data', data);
} catch (err) {
    console.log('Error', err);
}

If all goes well, this will log:

{ ItemContentCreationDate: Sat May 17 2014 14:32:53 GMT-0700 (PDT),
  ItemContentModificationDate: Sat May 17 2014 15:01:52 GMT-0700 (PDT),
  ItemContentType: 'com.netscape.javascript-source',
  ItemContentTypeTree:
   [ 'com.netscape.javascript-source',
     'public.source-code',
     'public.plain-text',
     'public.text',
     'public.data',
     'public.item',
     'public.content',
     'public.executable' ],
  ItemDateAdded: Sat May 17 2014 14:32:53 GMT-0700 (PDT),
  ItemDisplayName: 'index.js',
  ItemFSContentChangeDate: Sat May 17 2014 15:01:52 GMT-0700 (PDT),
  ItemFSCreationDate: Sat May 17 2014 14:32:53 GMT-0700 (PDT),
  ItemFSCreatorCode: '',
  ItemFSFinderFlags: 0,
  ItemFSHasCustomIcon: 0,
  ItemFSInvisible: 0,
  ItemFSIsExtensionHidden: 0,
  ItemFSIsStationery: 0,
  ItemFSLabel: 0,
  ItemFSName: 'index.js',
  ItemFSNodeCount: 1554,
  ItemFSOwnerGroupID: 20,
  ItemFSOwnerUserID: 501,
  ItemFSSize: 1554,
  ItemFSTypeCode: '',
  ItemKind: 'JavaScript',
  ItemLogicalSize: 1554,
  ItemPhysicalSize: 4096 }

Each date above is a JavaScript date object. You can get the Unix timestamp out with the getTime method of each object.

Note that running mdls the command line utility would have returned:

kMDItemContentCreationDate     = 2014-05-17 21:32:53 +0000
kMDItemContentModificationDate = 2014-05-17 22:01:52 +0000
kMDItemContentType             = "com.netscape.javascript-source"
kMDItemContentTypeTree         = (
    "com.netscape.javascript-source",
    "public.source-code",
    "public.plain-text",
    "public.text",
    "public.data",
    "public.item",
    "public.content",
    "public.executable"
)
kMDItemDateAdded               = 2014-05-17 21:32:53 +0000
kMDItemDisplayName             = "index.js"
kMDItemFSContentChangeDate     = 2014-05-17 22:01:52 +0000
kMDItemFSCreationDate          = 2014-05-17 21:32:53 +0000
kMDItemFSCreatorCode           = ""
kMDItemFSFinderFlags           = 0
kMDItemFSHasCustomIcon         = 0
kMDItemFSInvisible             = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery          = 0
kMDItemFSLabel                 = 0
kMDItemFSName                  = "index.js"
kMDItemFSNodeCount             = 1554
kMDItemFSOwnerGroupID          = 20
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 1554
kMDItemFSTypeCode              = ""
kMDItemKind                    = "JavaScript"
kMDItemLogicalSize             = 1554
kMDItemPhysicalSize            = 4096

Example with arguments

You can also pass in arguments (as a string):

try {
    const data = await mdls('./index.js', '-name kMDItemContentTypeTree');
    console.log('Data', data);
} catch (err) {
    console.log('Error', err);
}