Socket
Socket
Sign inDemoInstall

@thi.ng/diff

Package Overview
Dependencies
2
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @thi.ng/diff

Customizable diff implementations for arrays (sequential) & objects (associative), with or without linear edit logs


Version published
Weekly downloads
152
decreased by-16.94%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

diff

npm version npm downloads Twitter Follow

This project is part of the @thi.ng/umbrella monorepo.

About

Customizable diff implementations for arrays (sequential) & objects (associative), with or without linear edit logs.

Status

STABLE - used in production

Search or submit any issues for this package

Installation

yarn add @thi.ng/diff

ES module import:

<script type="module" src="https://cdn.skypack.dev/@thi.ng/diff"></script>

Skypack documentation

For Node.js REPL:

# with flag only for < v16
node --experimental-repl-await

> const diff = await import("@thi.ng/diff");

Package sizes (gzipped, pre-treeshake): ESM: 1.14 KB

Dependencies

API

Generated API docs

import { diffArray } from "@thi.ng/diff";

// diff w/ default diff mode
diffArray([1, 2, 3], [1, 2, 4], "full");
// {
//     distance: 2,
//     adds: { 2: 4 },
//     dels: { 2: 3 },
//     const: { 0: 1, 1: 2 },
//     linear: [0, 0, 1,  0, 1, 2,  -1, 2, 3,  1, 2, 4]
// }

Authors

Karsten Schmidt

If this project contributes to an academic publication, please cite it as:

@misc{thing-diff,
  title = "@thi.ng/diff",
  author = "Karsten Schmidt",
  note = "https://thi.ng/diff",
  year = 2016
}

License

© 2016 - 2022 Karsten Schmidt // Apache Software License 2.0

Keywords

FAQs

Last updated on 07 May 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc