{"id":13805179,"url":"https://github.com/nedpals/v-mime","last_synced_at":"2026-02-09T10:02:18.457Z","repository":{"id":97412753,"uuid":"197762208","full_name":"nedpals/v-mime","owner":"nedpals","description":"MIME Library for V.","archived":false,"fork":false,"pushed_at":"2019-12-28T14:22:10.000Z","size":56,"stargazers_count":24,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-27T22:47:41.622Z","etag":null,"topics":["mime","mime-types","v","vlang"],"latest_commit_sha":null,"homepage":null,"language":"V","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/nedpals.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-07-19T11:36:36.000Z","updated_at":"2024-07-09T21:22:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"31cafb28-1ca2-4919-a5bf-d816924a5a8e","html_url":"https://github.com/nedpals/v-mime","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nedpals/v-mime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nedpals%2Fv-mime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nedpals%2Fv-mime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nedpals%2Fv-mime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nedpals%2Fv-mime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nedpals","download_url":"https://codeload.github.com/nedpals/v-mime/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nedpals%2Fv-mime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29261651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["mime","mime-types","v","vlang"],"created_at":"2024-08-04T01:00:58.305Z","updated_at":"2026-02-09T10:02:18.421Z","avatar_url":"https://github.com/nedpals.png","language":"V","funding_links":[],"categories":["Libraries"],"sub_categories":["File handling"],"readme":"# V-MIME 0.1\nMIME library for the [V Programming Language](https://github.com/vlang/v). Inspired from the [mime-types](https://github.com/jshttp/mime-types) JS library.\n\nWhat does it do? It dentifies the MIME/data types of a file like `application/json`.\n\n## Usage\n```golang\nimport mime\n\n// As a workaround, alias the `MimeType` type\ntype MimeType mime.MimeType\n\nfn main() {\n    mime_db := mime.load()\n    filepath := './app.json'\n    filetype := mime_db.lookup(filepath)\n\n    println(filetype) // application/json\n}\n```\n\n## API\n\n### mime.lookup(path string)\n\nLookup the content-type associated with a file.\n\n```golang\nmime_db.lookup('json')             // 'application/json'\nmime_db.lookup('.md')              // 'text/markdown'\nmime_db.lookup('file.html')        // 'text/html'\nmime_db.lookup('folder/file.js')   // 'application/javascript'\nmime_db.lookup('folder/.htaccess') // ''\n\nmime_db.lookup('cats') // ''\n```\n\n### mime.content_type(type string)\n\nCreate a full content-type header given a content-type or extension.\nWhen given an extension, `mime_db.lookup` is used to get the matching\ncontent-type, otherwise the given content-type is used. Then if the\ncontent-type does not already have a `charset` parameter, `mime_db.charset`\nis used to get the default charset and add to the returned content-type.\n\n```golang\nmime_db.content_type('markdown')  // 'text/x-markdown; charset=utf-8'\nmime_db.content_type('file.json') // 'application/json; charset=utf-8'\nmime_db.content_type('text/html') // 'text/html; charset=utf-8'\nmime_db.content_type('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1'\n\n// from a full path\nmime_db.content_type(os.ext('/path/to/file.json')) // 'application/json; charset=utf-8'\n```\n\n### mime.extension(type string)\n\nGet the default extension for a content-type.\n\n```golang\nmime_db.extension('application/octet-stream') // 'bin'\n```\n\n### mime.charset(type string)\n\nLookup the implied default charset of a content-type.\n\n```golang\nmime_db.charset('text/markdown') // 'UTF-8'\n```\n\n## Contributing\n1. Fork it (\u003chttps://github.com/nedpals/v-mime/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## License\n[MIT](LICENSE)\n\n## Contributors\n\n- [Ned Palacios](https://github.com/nedpals) - creator and maintainer","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnedpals%2Fv-mime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnedpals%2Fv-mime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnedpals%2Fv-mime/lists"}