Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tennashi/deno-diff-manipulator
Manipulate diff
https://github.com/tennashi/deno-diff-manipulator
Last synced: 22 days ago
JSON representation
Manipulate diff
- Host: GitHub
- URL: https://github.com/tennashi/deno-diff-manipulator
- Owner: tennashi
- License: mit
- Created: 2021-09-26T16:18:52.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-26T16:22:06.000Z (about 3 years ago)
- Last Synced: 2023-08-08T20:44:07.329Z (over 1 year ago)
- Language: TypeScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# diff_manipulator
Manipulate diff## Usage
```ts
import { parse } from "https://deno.land/x/diff_parser";
import { removeHunk, removeHunksBefore, removeHunksAfter } from "https://deno.land/x/diff_manipulator";const process = Deno.run({
cmd: ["git", "diff", "--no-color"],
stdout: "piped",
})const output = await process.output();
const diffText = new TextDecoder().decode(output);
process.close();const diff = parse(diffText);
removeHunk(diff, 1);
removeHunksBefore(diff, 1);
removeHunksAfter(diff, 1);
```