{"id":32368938,"url":"https://github.com/olle/npmprobe","last_synced_at":"2026-05-15T08:04:02.980Z","repository":{"id":318443410,"uuid":"1071306176","full_name":"olle/npmprobe","owner":"olle","description":"Simple script that probes for compromised installed packages","archived":false,"fork":false,"pushed_at":"2026-05-12T08:30:38.000Z","size":46535,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-12T09:38:35.975Z","etag":null,"topics":["compliance","cve","malicious","npm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olle.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-07T06:59:58.000Z","updated_at":"2026-05-12T08:30:40.000Z","dependencies_parsed_at":"2025-12-18T15:04:59.939Z","dependency_job_id":null,"html_url":"https://github.com/olle/npmprobe","commit_stats":null,"previous_names":["olle/npmprobe"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/olle/npmprobe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olle%2Fnpmprobe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olle%2Fnpmprobe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olle%2Fnpmprobe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olle%2Fnpmprobe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olle","download_url":"https://codeload.github.com/olle/npmprobe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olle%2Fnpmprobe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33058965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["compliance","cve","malicious","npm"],"created_at":"2025-10-24T19:36:36.870Z","updated_at":"2026-05-15T08:04:02.975Z","avatar_url":"https://github.com/olle.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"NPM Probe\n=========\n\nA Go tool that does an exhaustive check for compromised installed `npm` packages\nfrom an authored list. Uses `mdfind` or `mlocate` to efficiently locate and search `package.json` and `package-lock.json` files across the system.\n\n\n## Building\n\nBuild cross-platform binaries for macOS and Linux:\n\n```sh\nmake build\n```\n\nThis produces binaries in the `bin/` directory:\n- `npmprobe` — macOS (Apple Silicon)\n- `npmprobe-linux-x86_64` — Linux (x86_64)\n\n### Testing on Linux with Docker\n\nBuild and test the Linux binary in a Docker container:\n\n```sh\ndocker build -t npmprobe:test .\ndocker run npmprobe:test\n```\n\nThe Dockerfile builds the npmprobe binary and runs it against the `compromised.txt` file\non a Linux Alpine system with the `locate` database pre-populated.\n\n## Makefile Targets\n\n- `make all` — builds binaries, normalizes the `compromised.txt` list, and runs a\n  verbose probe against the current system.\n- `make build` — cross-compiles binaries for macOS and Linux.\n- `make fmt` — formats all Go source files using `go fmt`.\n- `make prepare-list` — normalizes `compromised.txt` (sorts and removes duplicates).\n- `make docker-test` — builds and runs the Docker test image on Linux.\n\n## Quickstart\n\nProbe for all packages and versions in the `compromised.txt` file:\n\n```sh\n./bin/npmprobe -v compromised.txt\n[OK]   @operato/help@9.0.36 not present in any files\n[OK]   @operato/help@9.0.37 not present in any files\n[OK]   @operato/help@9.0.38 not present in any files\n...\n```\n\nProbing may take a while on first run (loading files into memory), and results\nare output to the console for further action. When a compromised package is found,\nit displays the matching files:\n\n```sh\n./bin/npmprobe compromised.txt\n...\n[FOUND] etag@1.8.1 in the following package files:\n\t/Users/me/Development/project/node_modules/express/package.json\n\t/Users/me/Development/project/node_modules/vite/package.json\n\t/Users/me/Development/project/node_modules/send/package.json\n```\n\n### Flags\n\n- `-h`: help. Displays usage information.\n\n- `-v`: verbose. When set, the tool prints packages that were not found in any\n  scanned `package.json`/`package-lock.json` files (lines prefixed with\n  `[OK]`). By default (without `-v`) only found matches (`[FOUND]`) are\n  printed.\n\n## Adding new packages\n\nEdit `compromised.txt` and normalize the list using:\n\n```sh\nmake prepare-list\n```\n\nThis sorts and removes duplicates. Then commit and push your changes.\n\n## Development\n\nThe program is organized around three core abstractions:\n\n**cmd/npmprobe/** — Main entry point handling CLI arguments, file I/O, and output formatting.\n\n**internal/finder/** — Loads the package store and provides the public API.\n\n**internal/parser/** — Parses compromised package lines supporting multiple formats (single versions, comma-separated versions).\n\n**internal/store/** — In-memory package database with query methods. Supports pluggable file finders.\n\n**internal/mdfind/** — Platform-specific file search (macOS mdfind, Linux locate, Windows filesystem walking).\n\n**internal/spinner/** — CLI spinner animation for user feedback during initialization.\n\nTo build: `make build` | To test: `go test ./...` | To format: `make fmt`\n\nHappy hacking!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folle%2Fnpmprobe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folle%2Fnpmprobe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folle%2Fnpmprobe/lists"}