{"id":25354200,"url":"https://github.com/cope/auto-change-description","last_synced_at":"2026-05-09T16:13:15.798Z","repository":{"id":57187215,"uuid":"107241761","full_name":"cope/auto-change-description","owner":"cope","description":"JSON Auto Change Description","archived":false,"fork":false,"pushed_at":"2022-03-02T11:17:17.000Z","size":117,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T10:44:11.537Z","etag":null,"topics":["javascript","json"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cope.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-17T08:45:41.000Z","updated_at":"2022-02-11T11:09:23.000Z","dependencies_parsed_at":"2022-08-28T13:00:23.143Z","dependency_job_id":null,"html_url":"https://github.com/cope/auto-change-description","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cope%2Fauto-change-description","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cope%2Fauto-change-description/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cope%2Fauto-change-description/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cope%2Fauto-change-description/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cope","download_url":"https://codeload.github.com/cope/auto-change-description/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247958703,"owners_count":21024823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","json"],"created_at":"2025-02-14T20:00:13.237Z","updated_at":"2025-10-24T06:03:24.866Z","avatar_url":"https://github.com/cope.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# auto-change-description\n[![build status](https://img.shields.io/travis/cope/auto-change-description.svg?branch=master)](https://travis-ci.org/cope/auto-change-description)\n[![codacy](https://img.shields.io/codacy/grade/699db0a812494db3b674123551f74a61.svg)](https://www.codacy.com/project/cope/auto-change-description/dashboard)\n[![coverage](https://img.shields.io/coveralls/github/cope/auto-change-description/master.svg)](https://coveralls.io/github/cope/auto-change-description?branch=master)\n[![dependencies](https://david-dm.org/cope/auto-change-description.svg)](https://www.npmjs.com/package/auto-change-description)\n[![npm](https://img.shields.io/npm/dt/auto-change-description.svg)](https://www.npmjs.com/package/auto-change-description)\n\nThis simple library compares two JSONs and lists the differences found as changes.\n\nThe library checks for created, deleted or modified plain attributes. This is done using [deep-diff](https://www.npmjs.com/package/deep-diff).\n\nArray attributes are treated as plain attributes and compared using [deep-equal](https://www.npmjs.com/package/deep-equal). If arrays contain any objects or other arrays, those are not separately considered.\n\nObjects are finally treated recursively.\n\n# Install\n\nWith [npm](http://npmjs.org) do:\n```\nnpm i --save auto-change-description\n```\n\n# Use\n\n```\nconst acd = require('auto-change-description');\nvar results = acd.describe(before, after);\n```\n\n#### Example\n\nComparing these two JSONs:\n```\n    var before = {\n        name: 'my object',\n        puppy: 'yo',\n        description: 'it\\'s an object!',\n        details: {\n            it: 'has',\n            an: 'array',\n            with: ['a', 'few', 'elements']\n        }\n    };\n    \n    var after = {\n        name: 'updated object',\n        yo: 'puppy',\n        description: 'it\\'s an object!',\n        details: {\n            it: 'has',\n            an: 'array',\n            with: ['a', 'few', 'more', 'elements', {than: 'before'}]\n        }\n    };\n```\nProduces this output:\n```\n[\n    'Deleted {puppy} with value (yo).',\n    'Created {yo} with value (puppy).',\n    'Modified {name} from (my object) to (updated object).',\n    'Modified {details.with} from ([\"a\",\"few\",\"elements\"]) to ([\"a\",\"few\",\"more\",\"elements\",{\"than\":\"before\"}]).'\n]\n```\nThe output was left as an array to allow free joining as people see fit, either with '\\n' or '\u0026lt;br\u0026gt;' or whatever else.\n\nThe same logic was applied to {} and () wraps, to allow easy replacement with, for example, \u0026lt;strong\u0026gt;\u0026lt;/strong\u0026gt;, \u0026lt;em\u0026gt;\u0026lt;/em\u0026gt; or any other formatting syntaxes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcope%2Fauto-change-description","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcope%2Fauto-change-description","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcope%2Fauto-change-description/lists"}