{"id":18202,"library":"changed-http","title":"changed-http","description":"Polls HTTP/HTTPS resources and fires events when the response body changes. Version 0.0.3 is the latest (and only) release as of early 2013, with no updates since. Minimalist library using Node.js http/https modules, gzip decoding, and a custom compare function. Unlike general-purpose polling libraries, it is specifically scoped to monitoring HTTP content changes. No longer maintained; consider using newer alternatives or the built-in fetch with manual polling.","status":"abandoned","version":"0.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/robinjmurphy/changed","tags":["javascript","poll","http","changed"],"install":[{"cmd":"npm install changed-http","lang":"bash","label":"npm"},{"cmd":"yarn add changed-http","lang":"bash","label":"yarn"},{"cmd":"pnpm add changed-http","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Only CommonJS (require) is supported; no ESM exports. No default export; the require returns the module object.","wrong":"import changed from 'changed-http';","symbol":"changed","correct":"const changed = require('changed-http');"},{"note":"Resource is a named property of the required object, but also accessible via changed.Resource.","wrong":"const { Resource } = require('changed-http').Resource;","symbol":"Resource","correct":"const { Resource } = require('changed-http');"},{"note":"logger is a property on the module object itself; it expects a logger object (e.g., winston) with .info method.","wrong":"changed.logger = 'custom logger';","symbol":"logger","correct":"changed.logger = winston;"}],"quickstart":{"code":"const changed = require('changed-http');\nconst resource = new changed.Resource('http://example.com', {\n  compare: function(current, previous) {\n    return current !== previous;\n  }\n});\nresource.on('changed', function(current, previous) {\n  console.log('Resource changed!');\n});\nresource.startPolling(5000);","lang":"javascript","description":"Creates a Resource polling http://example.com every 5 seconds, logs 'Resource changed!' when body changes. Demonstrates event-based monitoring."},"warnings":[{"fix":"Consider using modern alternatives like node-fetch with manual polling or chokidar for file changes.","message":"Package is unmaintained; no updates since 2013. May have unresolved HTTP parsing issues or vulnerabilities.","severity":"gotcha","affected_versions":"0.0.3"},{"fix":"Create a custom .d.ts file or use as any.","message":"No TypeScript types. No d.ts files; using with TS requires manual type declarations.","severity":"gotcha","affected_versions":"0.0.3"},{"fix":"Ensure compare returns a boolean: true if changed, false otherwise.","message":"The compare function overrides the default string comparison. If it returns false in a truthy check, no 'changed' event fires.","severity":"gotcha","affected_versions":"0.0.3"},{"fix":"Always pass a positive number.","message":"startPolling() only accepts one argument (interval). It does not check for valid number; passing undefined or null uses default 10000ms.","severity":"gotcha","affected_versions":"0.0.3"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install robinjmurphy/changed","cause":"Package not installed correctly; old package name or npm install used wrong syntax.","error":"Error: Cannot find module 'changed-http'"},{"fix":"Use const changed = require('changed-http'); then new changed.Resource(...)","cause":"Import as default using import statement; no default export.","error":"TypeError: changed.Resource is not a constructor"},{"fix":"Use new changed.Resource(url, options)","cause":"Missing new keyword when constructing Resource.","error":"TypeError: resource.on is not a function"},{"fix":"Return true when content differs, false otherwise.","cause":"Custom compare function returns a falsy value when change is detected, or truthy when no change.","error":"AssertionError: false == true (in compare function)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}