{"id":21337758,"url":"https://github.com/freeslave/mime","last_synced_at":"2026-01-03T06:05:53.830Z","repository":{"id":33794691,"uuid":"37486652","full_name":"FreeSlave/mime","owner":"FreeSlave","description":"Shared MIME-info database in D programming language","archived":false,"fork":false,"pushed_at":"2021-06-13T11:18:21.000Z","size":232,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T14:45:50.881Z","etag":null,"topics":["d","dlang","freedesktop","mime","mime-database","mime-types","xdg"],"latest_commit_sha":null,"homepage":"","language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FreeSlave.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_1_0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-15T19:31:39.000Z","updated_at":"2024-01-09T06:32:30.000Z","dependencies_parsed_at":"2022-09-14T11:11:00.606Z","dependency_job_id":null,"html_url":"https://github.com/FreeSlave/mime","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreeSlave%2Fmime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreeSlave%2Fmime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreeSlave%2Fmime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreeSlave%2Fmime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FreeSlave","download_url":"https://codeload.github.com/FreeSlave/mime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814893,"owners_count":20352038,"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":["d","dlang","freedesktop","mime","mime-database","mime-types","xdg"],"created_at":"2024-11-22T00:01:26.048Z","updated_at":"2026-01-03T06:05:53.818Z","avatar_url":"https://github.com/FreeSlave.png","language":"D","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mime\n\n[Shared MIME-info database](https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/) specification implementation in D programming language. Shared MIME-info database helps to determine media type of file by its name or contents.\n\n[![Build Status](https://github.com/FreeSlave/mime/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/FreeSlave/mime/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/FreeSlave/mime/badge.svg?branch=master)](https://coveralls.io/github/FreeSlave/mime?branch=master)\n\n[Online documentation](https://freeslave.github.io/d-freedesktop/docs/mime.html)\n\n## Features\n\n### Implemented features\n\n* Reading and using mime.cache files to match file names against glob patterns, match file contents against magic rules, resolve aliases and find mime type parents.\n* Reading various shared MIME-info database files in mime/ subfolder, e.g. globs2, magic and others.\n* treemagic support.\n* Reading MIME types from mime/packages sources and mime/MEDIA folders.\n* Determining MIME type by XMLnamespace if document is xml.\n\n## Examples\n\n### [Mime Database](examples/database.d)\n\nRun to detect mime types of files.\n\n    dub examples/database.d detect README.md source .gitignore lib/libmime.a /bin/sh /var/run/acpid.socket dub.json /dev/sda\n\nAutomated mime path detection works only on Freedesktop platforms. On other systmes or for testing purposes it's possible to use mimepath option to set alternate path to mime/ subfolder. E.g. on Windows with KDE installed it would be:\n\n    dub examples/database.d --mimepath=C:\\ProgramData\\KDE\\share\\mime detect README.md source .gitignore lib/mime.lib C:/Windows/System32/notepad.exe dub.json\n\nRun to print info about MIME types:\n\n    dub examples/database.d info application/pdf application/x-executable image/png text/plain text/html text/xml\n\nRun to resolve aliases:\n\n    dub examples/database.d resolve application/wwf application/x-pdf application/pgp text/rtf text/xml\n\n### [Mime Test](examples/test.d)\n\nRun to test if this library is capable of parsing your local shared MIME-info database:\n\n    dub examples/test.d\n\nRun to see names of parsed files:\n\n    dub examples/test.d --verbose\n\nAs with mimedatabase example you may specify paths to *mime* folder(s) via command line:\n\n    dub examples/test.d --mimepath=C:\\ProgramData\\KDE\\share\\mime\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreeslave%2Fmime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreeslave%2Fmime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreeslave%2Fmime/lists"}