A tool for Microsoft Flight Simulator (MSFS) developers to automatically generate and update layout.json files for their add-ons.
-
Automatic Layout Generation
Scans package directories and createslayout.jsonwith file metadata -
Watch changes in Package Directory
Scans all changes in provided directory and updateslayout.jsonaccordingly -
Manifest Integration
Automatically updatestotal_package_sizeinmanifest.json -
Multiple Processing Modes
Process single packages, multiple packages, or batch operations -
Batch Processing
Interactive Windows batch file with menu system for easy use -
Flexible CLI
Command-line interface with various options for different workflows -
TypeScript Support
Fully typed API for programmatic usage
- Download
msfs-layout-generator.batfrom the latest release - Place it in your desired directory
- Double-click to run
- Choose options from the interactive menu
npm install -g msfs-layout-generatorUse your manager (npm, yarn, bun etc.) to install the package:
npm install msfs-layout-generatorimport { generateLayout } from 'msfs-layout-generator';
// Process a single package (throws on errors, uses default options)
await generateLayout("F:\\fs20\\Community\\my-package"); import { processLayout } from 'msfs-layout-generator';
import type { ProcessOptions, ProcessResult } from 'msfs-layout-generator';
// Overwrite existing layout.json silently
await processLayout("./my-package", { force: true, quiet: true });
// Get a result object instead of throwing on errors
const result = await processLayout("./my-package", {
returnResult: true,
force: true
});
if (result.success) {
console.log(`Processed ${result.fileCount} files (${result.totalSize} bytes)`);
} else {
console.error(result.message);
}
// Generate layout without requiring or updating manifest.json
await processLayout("./my-package", {
force: true,
checkManifest: false,
skipManifestUpdate: true
});| Export | Type | Description |
|---|---|---|
generateLayout(dir) |
(dir: string) => Promise<void> |
Simple wrapper — processes a package directory with default options. Throws on errors. |
processLayout(dir, options?) |
(dir: string, options?: ProcessOptions) => Promise<void | ProcessResult> |
Full-featured function with configurable options. |
| Option | Type | Default | Description |
|---|---|---|---|
force |
boolean |
false |
Overwrite existing layout.json |
quiet |
boolean |
false |
Suppress all console output |
debug |
boolean |
false |
Enable verbose debug logging |
checkManifest |
boolean |
true |
Require manifest.json to exist in the package directory |
skipManifestUpdate |
boolean |
false |
Skip updating total_package_size in manifest.json |
returnResult |
boolean |
false |
Return a ProcessResult object instead of void. When true, errors are returned in the result instead of thrown. |
Returned when returnResult is true:
| Field | Type | Description |
|---|---|---|
success |
boolean |
Whether the operation completed successfully |
fileCount |
number |
Number of files included in layout.json |
totalSize |
number |
Total package size in bytes |
layoutPath |
string |
Absolute path to the generated layout.json |
manifestPath |
string |
Absolute path to manifest.json |
skippedFiles |
number |
Number of files that were excluded |
message |
string? |
Error message (when success is false) |
Happy Flying!
