This is a simple tool to generate a list of Material Icons available in the Material Icons font. It uses This Repo as a source.
IMPORTANT: This tool requires Internet connection to work.
Rate Limits: This tool uses GitHub's API which has rate limits. For better performance and higher rate limits, set up a GitHub token:
- Environment Variable: Set
GITHUB_TOKENenvironment variable- Or use .env file: Copy
env.exampleto.envand add your token- Get a token: Visit GitHub Settings > Tokens (no special permissions needed)
# if you want to install it globally npm i -g milist milist > output.txt # Uses codepoints source (most comprehensive) milist --json > output.json # Uses codepoints source with JSON output milist --ts > material-icons.ts # Uses codepoints source with TypeScript output milist --source web > web-icons.txt # Uses web source specifically # if you want to use just once npx milist > output.txt # Uses codepoints source (most comprehensive) npx milist --json > output.json # Uses codepoints source with JSON output npx milist --ts > material-icons.ts # Uses codepoints source with TypeScript output npx milist --source web > web-icons.txt # Uses web source specifically
const { list } = require('milist'); const icons: string[] = list('web'); console.log(icons); // list of icons in string[] format
import { list } from 'milist'; const icons: string[] = list('web'); console.log(icons); // list of icons in string[] format
android: will use the android sourceios: will use the ios sourceweb: will use the web sourcecode: will use the codepoints file (most comprehensive list, includes all Material Symbols) [DEFAULT]
Note: If --source is omitted, code is used by default as it provides the most comprehensive list of 4,095+ Material Icons.
--json: With JSON format--text: With simple text format (each name in a new line)--ts: With TypeScript format (const array + type definition)
// Generated with: milist --ts > material-icons.ts (uses code source by default) export const icons = [ "10k", "10mp", "home", "search", // ... all 4,095+ icons from codepoints ] as const; export type MaterialIcon = typeof icons[number]; // Usage in your TypeScript project: import { icons, MaterialIcon } from './material-icons'; const myIcon: MaterialIcon = "home"; // Type-safe! const iconExists = icons.includes("search"); // true
This package includes comprehensive tests:
# Run all tests npm test # Run specific test suites npm run test:simple # Basic functionality tests npm run test:cli # Command-line interface tests npm run test:functional # Real API tests (requires GITHUB_TOKEN) # Run tests with coverage npm run test:coverage # Watch mode for development npm run test:watch
Note: Functional tests require a GITHUB_TOKEN environment variable for better rate limits when testing against the real GitHub API.