JS文本差分 Jsdiff

码农软件 · 软件分类 · 其他开发相关 · 2019-10-18 16:57:22

软件介绍

Jsdiff是一款实现javascript文本差分的软件。

安装:

npm install diff

或者

bower install jsdiff

API

  • JsDiff.diffChars(oldStr, newStr[, options]) - diffs two blocks of text, comparing character by character.

    Returns a list of change objects (See below).

  • JsDiff.diffWords(oldStr, newStr[, options]) - diffs two blocks of text, comparing word by word, ignoring whitespace.

    Returns a list of change objects (See below).

  • JsDiff.diffWordsWithSpace(oldStr, newStr[, options]) - diffs two blocks of text, comparing word by word, treating whitespace as significant.

    Returns a list of change objects (See below).

  • JsDiff.diffLines(oldStr, newStr[, options]) - diffs two blocks of text, comparing line by line.

选择:

  • ignoreWhitespace: true to ignore leading and trailing whitespace. This is the same as diffTrimmedLines

  • newlineIsToken: true to treat newline characters as separate tokens.  This allows for changes to the newline structure to occur independently of the line content and to be treated as such. In general this is the more human

  • dly form of diffLines and diffLines is better suited for patches and other computer friendly output.

兼容性:

 Jsdiff支持所有ES3环境和IE8以下一些已知问题。这些浏览器存在一些差异算法,如文字diff和其他可能由于缺乏拆分操作捕获组支持的失败操作。

本文地址:https://codercto.com/soft/d/17040.html

Go程序设计语言

Go程序设计语言

艾伦 A. A. 多诺万 / 李道兵、高博、庞向才、金鑫鑫、林齐斌 / 机械工业出版社 / 2017-5 / 79

本书由《C程序设计语言》的作者Kernighan和谷歌公司Go团队主管Alan Donovan联袂撰写,是学习Go语言程序设计的指南。本书共13章,主要内容包括:Go的基础知识、基本结构、基本数据类型、复合数据类型、函数、方法、接口、goroutine、通道、共享变量的并发性、包、go工具、测试、反射等。 本书适合作为计算机相关专业的教材,也可供Go语言爱好者阅读。一起来看看 《Go程序设计语言》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试