{"id":16490726,"url":"https://github.com/awinterman/node-mdls","last_synced_at":"2025-10-27T20:31:42.685Z","repository":{"id":17131038,"uuid":"19897384","full_name":"AWinterman/node-mdls","owner":"AWinterman","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-15T20:00:27.000Z","size":94,"stargazers_count":2,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T08:05:20.088Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AWinterman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE-MIT.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-17T22:07:40.000Z","updated_at":"2022-02-11T23:29:31.000Z","dependencies_parsed_at":"2022-09-24T13:21:45.163Z","dependency_job_id":null,"html_url":"https://github.com/AWinterman/node-mdls","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fnode-mdls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fnode-mdls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fnode-mdls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fnode-mdls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AWinterman","download_url":"https://codeload.github.com/AWinterman/node-mdls/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238553171,"owners_count":19491383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T13:48:52.787Z","updated_at":"2025-10-27T20:31:37.388Z","avatar_url":"https://github.com/AWinterman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mdls\n\nOSX's mdls from node.\n\nA thin wrapper around [mdls](https://developer.apple.com/library/Mac/documentation/Darwin/Reference/ManPages/man1/mdls.1.html).\n\nYou give it a path, it runs mdls and calls a callback with the result.\n\n## Install\n\n`npm install --save mdls`\n\n## Usage\n\n### Basic example\n\n```js\ntry {\n    const data = await mdls('./index.js');\n    console.log('Data', data);\n} catch (err) {\n    console.log('Error', err);\n}\n```\n\nIf all goes well, this will log:\n\n```\n{ ItemContentCreationDate: Sat May 17 2014 14:32:53 GMT-0700 (PDT),\n  ItemContentModificationDate: Sat May 17 2014 15:01:52 GMT-0700 (PDT),\n  ItemContentType: 'com.netscape.javascript-source',\n  ItemContentTypeTree:\n   [ 'com.netscape.javascript-source',\n     'public.source-code',\n     'public.plain-text',\n     'public.text',\n     'public.data',\n     'public.item',\n     'public.content',\n     'public.executable' ],\n  ItemDateAdded: Sat May 17 2014 14:32:53 GMT-0700 (PDT),\n  ItemDisplayName: 'index.js',\n  ItemFSContentChangeDate: Sat May 17 2014 15:01:52 GMT-0700 (PDT),\n  ItemFSCreationDate: Sat May 17 2014 14:32:53 GMT-0700 (PDT),\n  ItemFSCreatorCode: '',\n  ItemFSFinderFlags: 0,\n  ItemFSHasCustomIcon: 0,\n  ItemFSInvisible: 0,\n  ItemFSIsExtensionHidden: 0,\n  ItemFSIsStationery: 0,\n  ItemFSLabel: 0,\n  ItemFSName: 'index.js',\n  ItemFSNodeCount: 1554,\n  ItemFSOwnerGroupID: 20,\n  ItemFSOwnerUserID: 501,\n  ItemFSSize: 1554,\n  ItemFSTypeCode: '',\n  ItemKind: 'JavaScript',\n  ItemLogicalSize: 1554,\n  ItemPhysicalSize: 4096 }\n```\n\nEach date above is a JavaScript date object. You can get the Unix timestamp out\nwith the `getTime` method of each object.\n\nNote that running `mdls` the command line utility would have returned:\n\n```\nkMDItemContentCreationDate     = 2014-05-17 21:32:53 +0000\nkMDItemContentModificationDate = 2014-05-17 22:01:52 +0000\nkMDItemContentType             = \"com.netscape.javascript-source\"\nkMDItemContentTypeTree         = (\n    \"com.netscape.javascript-source\",\n    \"public.source-code\",\n    \"public.plain-text\",\n    \"public.text\",\n    \"public.data\",\n    \"public.item\",\n    \"public.content\",\n    \"public.executable\"\n)\nkMDItemDateAdded               = 2014-05-17 21:32:53 +0000\nkMDItemDisplayName             = \"index.js\"\nkMDItemFSContentChangeDate     = 2014-05-17 22:01:52 +0000\nkMDItemFSCreationDate          = 2014-05-17 21:32:53 +0000\nkMDItemFSCreatorCode           = \"\"\nkMDItemFSFinderFlags           = 0\nkMDItemFSHasCustomIcon         = 0\nkMDItemFSInvisible             = 0\nkMDItemFSIsExtensionHidden     = 0\nkMDItemFSIsStationery          = 0\nkMDItemFSLabel                 = 0\nkMDItemFSName                  = \"index.js\"\nkMDItemFSNodeCount             = 1554\nkMDItemFSOwnerGroupID          = 20\nkMDItemFSOwnerUserID           = 501\nkMDItemFSSize                  = 1554\nkMDItemFSTypeCode              = \"\"\nkMDItemKind                    = \"JavaScript\"\nkMDItemLogicalSize             = 1554\nkMDItemPhysicalSize            = 4096\n```\n\n### Example with arguments\n\nYou can also pass in arguments (as a string):\n\n```js\ntry {\n    const data = await mdls('./index.js', '-name kMDItemContentTypeTree');\n    console.log('Data', data);\n} catch (err) {\n    console.log('Error', err);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawinterman%2Fnode-mdls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawinterman%2Fnode-mdls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawinterman%2Fnode-mdls/lists"}