method FileHandlerManager.prototype.previewChanges
FileHandlerManager.prototype.previewChanges(
filePath: string,
key: string,
newValue: string,
): Promise<FileChangePreview>

Preview what would change in a file

Examples

Example 1

const preview = await manager.previewChanges(
  "./README.md",
  "version",
  "2.0.0"
);

for (const match of preview.matches) {
  console.log(`Line ${match.line}: ${match.original} → ${match.updated}`);
}

Parameters

filePath: string
  • Path to the file
key: string
  • Key to update
newValue: string
  • New value to preview

Return Type

Preview of changes

Usage

import { FileHandlerManager } from ".";