Typer-Diff, a npm package for comparing two typed strings

#Typescript#Turborepo#Nextjs#Changeset

Typer Diff Project

typer-diff

Typer Diff allows you to compare two strings and receive a detailed report on the differences between them. The library provides a simple API that makes it easy to use in your application.

Key Features

Usage

To use Typer Diff in your project, you can install it using npm:

Terminal window
npm i typer-diff

Then, you can import the library and use its API to compare two strings. For example:

import { diff } from "typer-diff";
// ...
return diff(text.original, text.text);
// ...

Types

Typer Diff provides several types that you can use in your project:

Design Decisions

I chose to use TypeScript to take advantage of its type safety features and improve code quality. Additionally, I implemented auto-versioning using Changeset, which allows me to keep track of changes and releases efficiently. To automate the build, testing, and deployment process, I set up GitHub CI/CD pipelines. Finally, I used Turborepo to speed up development and separate packages from documentation.

Demo

Check out a live demo of Typer Diff in action at typer-diff.vercel.app.