winmd
7.1.1, released 4 months ago by halildurmus.dev
Inspect and generate Windows Metadata (.winmd) files based on ECMA-335.
What it does
Inspects and generates Windows Metadata (.winmd) files based on the ECMA-335 standard. It parses .winmd files into strongly-typed object models, queries type definitions, merges files, and programmatically generates new metadata.
AI-written summary of version 7.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to parse or generate Windows Metadata (.winmd) files in Dart
- You are building Windows interop tooling or need to introspect WinRT types cross-platform
Skip it when
- You are building standard cross-platform UI apps that do not deal with low-level Windows metadata
Strengths
- Cross-platform support (Windows, macOS, Linux) via direct binary parsing
- Rich introspection of nested types, constants, parameters, and attributes
- Supports writing and merging metadata
Weaknesses
- Low-level domain-specific tool, not needed for typical application development
Setup
- Kind
- FFI (native library)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 7
Add the package to pubspec.yaml and import it.
import 'dart:io' as io;
import 'package:winmd/winmd.dart';
void main() {
const winmdPath = r'C:\WINDOWS\System32\WinMetadata\Windows.Storage.winmd';
final bytes = io.File(winmdPath).readAsBytesSync();
final reader = MetadataReader.read(bytes);
final index = MetadataIndex.fromReader(reader);
final metadata = MetadataLookup(index);
final storageFile = metadata.findSingleTypeByName('StorageFile');
print('WinRT class "${storageFile.name}" has the following methods:');
for (final method in storageFile.methods) {
print(' ${method.name}');
}
}Alternatives
Packages that do the same job and could replace winmd.
- mason
Dart template generator for quick file creation
89Compare - protobuf
Provides runtime support for Dart protocol buffer messages generated by protoc_plugin.
84Compare - pubspec_extract
Extracts Dart pubspec.yaml file and generates pubspec.dart at build time
75Compare - documentation_builder
Generates documentation files from template files, importing other files or Dart documentation comments.
64Compare
Works with
Packages commonly used together with winmd: ones it builds on, ones built on it, and its own family.
- archivewinmd depends on itEncodes and decodes archive and compression formats such as zip, tar, gzip, and zlib.
- ffiwinmd depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- loggingwinmd depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- cli_utilwinmd depends on itUtilities to help build Dart command-line apps, find the SDK, and display progress.