{"id":16587506,"url":"https://github.com/alexpasmantier/rust-devicons","last_synced_at":"2025-04-09T16:05:25.968Z","repository":{"id":256195617,"uuid":"854570068","full_name":"alexpasmantier/rust-devicons","owner":"alexpasmantier","description":"A Rust library that provides filetype glyphs (icons) for a wide range of common file formats.","archived":false,"fork":false,"pushed_at":"2024-12-28T23:20:56.000Z","size":63,"stargazers_count":30,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T16:05:21.447Z","etag":null,"topics":["cli","devicons","filetype","glyphs","icons","nerd-fonts","rust","rust-crate"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/devicons","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexpasmantier.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-09T12:13:00.000Z","updated_at":"2025-03-31T03:14:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"e24535b5-a173-421b-912c-3ae2da4110d1","html_url":"https://github.com/alexpasmantier/rust-devicons","commit_stats":null,"previous_names":["alexpasmantier/devicons","alexpasmantier/rust-devicons"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpasmantier%2Frust-devicons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpasmantier%2Frust-devicons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpasmantier%2Frust-devicons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpasmantier%2Frust-devicons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexpasmantier","download_url":"https://codeload.github.com/alexpasmantier/rust-devicons/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065288,"owners_count":21041871,"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":["cli","devicons","filetype","glyphs","icons","nerd-fonts","rust","rust-crate"],"created_at":"2024-10-11T22:54:23.418Z","updated_at":"2025-04-09T16:05:25.949Z","avatar_url":"https://github.com/alexpasmantier.png","language":"Rust","readme":"![GitHub branch check runs](https://img.shields.io/github/check-runs/alexpasmantier/rust-devicons/main)\n![docs.rs](https://img.shields.io/docsrs/devicons)\n![Crates.io Total Downloads](https://img.shields.io/crates/d/devicons)\n![GitHub License](https://img.shields.io/github/license/alexpasmantier/rust-devicons)\n![Crates.io Version](https://img.shields.io/crates/v/devicons)\n![Crates.io Size](https://img.shields.io/crates/size/devicons)\n\n\n\n\n# 🦀 `rust-devicons`\n\nA Rust library inspired by [vim-devicons](https://github.com/ryanoasis/vim-devicons), that provides filetype glyphs (icons) for a wide range of common file formats.\n\n\u003cimg width=\"2197\" alt=\"rust-devicons\" src=\"https://github.com/user-attachments/assets/f2beb589-f97d-4afd-9262-483f59bc2ad8\"\u003e\n\n## Features\n\n- 🦞 **Icon Retrieval**: Get file or directory icons based on file name/extension.\n- 🦞 **Icon Color**: Retrieve the color associated with the icon depending on the specified theme.\n- 🦞 **Filetype Support**: Supports a wide range of filetypes and filename conventions (dockerfile, makefile, etc.).\n- 🦞 **Customizable Themes**: Supports both light and dark themes.\n\n\u003cimg width=\"1443\" alt=\"Screenshot 2024-09-21 at 16 54 16\" src=\"https://github.com/user-attachments/assets/4e60cb61-2e02-4f21-965c-2b934a15575c\"\u003e\n\n\n## Installation\n\n```sh\ncargo add devicons\n```\n\n_**NOTE**: you'll need to use a [NerdFont](https://www.nerdfonts.com/) to properly display the icons._\n\n## Usage\n\nHere’s a simple example of how to use `devicons` to retrieve a file icon with the dark theme:\n\n```rust\nuse std::path::Path;\nuse devicons::{File, Theme, icon_for_file, FileIcon};\n\nfn main() {\n    // getting the icon from a path with a specified theme\n    let path = Path::new(\"Cargo.toml\");\n    let icon = icon_for_file(path, Some(Theme::Dark));\n\n    // getting the icon from a string with a specified theme\n    let icon = icon_for_file(\"Cargo.toml\", Some(Theme::Dark));\n\n    // getting the icon from a path with the default theme\n    let icon = FileIcon::from(path);\n\n    // directly getting an icon from a filename\n    let icon = FileIcon::from(\"Cargo.toml\");\n\n    println!(\"File: {}\", path.to_string_lossy());\n    println!(\"Icon: {}\", icon.icon);\n    println!(\"Color: {}\", icon.color);\n}\n```\n\n### Running the Examples\n\nYou can find more usage examples in the `examples` directory. To run them, use:\n\n```bash\ncargo run --example \u003cexample_name\u003e\n```\n\n## License\n\nThis project is licensed under the [Apache 2.0 License](LICENSE). \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpasmantier%2Frust-devicons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexpasmantier%2Frust-devicons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpasmantier%2Frust-devicons/lists"}