# diff-state **Repository Path**: mirrors_silverwind/diff-state ## Basic Information - **Project Name**: diff-state - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-25 - **Last Updated**: 2026-08-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # diff-state [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) [![npm version](https://badge.fury.io/js/diff-state.svg)](https://badge.fury.io/js/diff-state) [![Build Status](https://travis-ci.org/jonestristand/diff-state.svg?branch=master)](https://travis-ci.org/jonestristand/diff-state) > This is a simple module to diff two state objects that are assumed to contain the same keys. Keys whose value has changed will be returned with their new value. ## Table of Contents - [Install](#install) - [Usage](#usage) - [Testing](#testing) - [API](#api) - [Maintainers](#maintainers) - [Contribute](#contribute) - [License](#license) ## Install ``` npm install -s diff-state ``` ## Usage ``` const diffState = require('diff-state'); var oldState = { a: 'test', b: 23, c: { d: true, e: '123' } } var newState = { a: 'no', b: 23, c: { d: false, e: '123' } } var patch = diffState(newState, oldState); /* patch = { a: 'no', c: { d: true } } */ ``` ## Testing ``` npm test ``` ## Maintainers [@jonestristand](https://github.com/jonestristand) ## Contribute PRs accepted. Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification. ## License MIT © 2017 Tristan Jones