GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - icflorescu/textdiff-patch: Apply lean text diff delta patches created by textdiff-create.

BranchesTags
Open more actions menu

Latest commit

 

History

33 Commits
33 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
test
test
 
 
.eslintrc.cjs
.eslintrc.cjs
 
 
.gitignore
.gitignore
 
 
.prettierrc
.prettierrc
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.js
index.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

textdiff-patch

NPM version License Downloads Sponsor the author

textdiff-patch

This is a simple module for applying lean text diff delta patches created by textdiff-create.

β€οΈπŸ‡ΊπŸ‡¦

See below.

Usage

Assuming you've correctly installed the npm module with npm i textdiff-patch [--save|--save-dev]:

const applyPatch = require('textdiff-patch');

const v1 = 'The sleepy brown fox';
const delta = [
      [0, 4],
      [-1, 6],
      [1, 'quick'],
      [0, 10],
      [1, ' jumps over the lazy dog']
    ];

const v2 = applyPatch(v1, delta);

console.log(v2);

The script will produce the following output:

The quick brown fox jumps over the lazy dog

Additional info

Have a look at textdiff-create for more info.

Credits & support

If you find this piece of software useful, please star the repo, spread the word, sponsor my work and feel free to endorse me on LinkedIn:

Ionut-Cristian Florescu on LinkedIn

Stand with Ukraine

On 24th of February 2022 Russia unlawfully invaded Ukraine. This is an unjustified, unprovoked attack on the sovereignty of a neighboring country, but also an open affront to international peace and stability that has the potential to degenerate into a nuclear event threatening the very existence of humanity. I am a Romanian (EU) citizen, but I stand with Ukraine and I am doing everything in my power to stop this madness. Here's how you can show your support.

LICENSE

Released under ISC.

About

Apply lean text diff delta patches created by textdiff-create.

Topics

diffjavascriptnodejstext-diff

Resources

Readme
ISC license
Activity

Stars

18 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.