{"id":15637795,"url":"https://github.com/megapixel99/packagediffremote","last_synced_at":"2025-03-29T21:11:56.243Z","repository":{"id":57317786,"uuid":"448219108","full_name":"Megapixel99/packageDiffRemote","owner":"Megapixel99","description":"Show diff of NPM packages","archived":false,"fork":false,"pushed_at":"2022-01-15T22:47:22.000Z","size":41708,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T11:57:46.029Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Megapixel99.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-15T08:13:18.000Z","updated_at":"2022-01-15T08:21:37.000Z","dependencies_parsed_at":"2022-08-25T20:40:24.684Z","dependency_job_id":null,"html_url":"https://github.com/Megapixel99/packageDiffRemote","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megapixel99%2FpackageDiffRemote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megapixel99%2FpackageDiffRemote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megapixel99%2FpackageDiffRemote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megapixel99%2FpackageDiffRemote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Megapixel99","download_url":"https://codeload.github.com/Megapixel99/packageDiffRemote/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246243553,"owners_count":20746311,"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":[],"created_at":"2024-10-03T11:12:51.173Z","updated_at":"2025-03-29T21:11:56.224Z","avatar_url":"https://github.com/Megapixel99.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# packageDiffRemote\n\n[![npm version](https://img.shields.io/npm/v/packagediffremote.svg?style=flat-square)](https://www.npmjs.org/package/packagediffremote)\n[![npm downloads](https://img.shields.io/npm/dm/packagediffremote.svg?style=flat-square)](http://npm-stat.com/charts.html?package=packagediffremote)\n\nThe purpose of this package is to show the differences between the code in NodeJS modules/packages (which are often downloaded from NPM) and the code for NodeJS modules/packages (which is often hosted on GitHub). This module was inspired by this article: https://therecord.media/malware-found-in-coa-and-rc-two-npm-packages-with-23m-weekly-downloads/ where malware was found in two popular NPM modules/packages.\n\n### CLI\n\nThe executables provided in the `executables` folder allow this module/package to be used as a cli application. You will need to download the appropriate executable and configure the command yourself though (so you do not have to use the full executable path).\n\nAll of the executables were built using Node v12.16.3 and used the `pkg` module/package\n\n### API\n\nThis package also exposes an API which can be used in other projects.\n\nTo use the API please run the following command:\n\n```shell\nnpm i packagediffremote\n```\n\nAn example usage of the API can be seen below:\n```javascript\nconst packageDiffRemote = require('packagediffremote');\n\npackageDiffRemote().then(function (data) {\n  console.log(data);\n}).catch(function (err) {\n  console.error(err);\n})\n\n```\nThe method packagediffremote can take three optional parameters (in the order shown below):\n\n`folder - string - specify a folder to check (defaults to node_modules)`\n\n`package - string - specify a package to check (defaults to all packages in the folder)`\n\n`verbose - boolean - output additional logs`\n\n```javascript\nconst packageDiffRemote = require('packagediffremote');\n\npackageDiffRemote(folder, package, verbose)\n\n```\n\nThe output of data (from the code sample above) will be structured as follows:\n```json\n[\n  {\n    \"file\": \"absolute/path/to/file\",\n    \"diff\": [\n      {\n        \"count\": 5,\n        \"value\": \"some string\"\n      },\n      {\n        \"count\": 1,\n        \"added\": undefined,\n        \"removed\": true,\n        \"value\": \"string\"\n      },\n      {\n        \"count\": 10,\n        \"added\": true,\n        \"removed\": undefined,\n        \"value\": \"different string\"\n      }\n    ]\n  }\n]\n```\n\n##### To Do\n\nCurrently the only supported hosting platform is GitHub which is not ideal... Ideally this package would support more hosting platforms...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegapixel99%2Fpackagediffremote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmegapixel99%2Fpackagediffremote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegapixel99%2Fpackagediffremote/lists"}