{"id":47720,"library":"ft-poller","title":"FT Poller","description":"An HTTP client library for periodically fetching and caching data from web services. Current stable version is 11.0.1, released with support for Node.js 20.x and 22.x. It provides a simple polling mechanism with built-in caching and error handling, differentiating itself from generic polling libraries by its focus on HTTP services and integration with Financial Times' infrastructure. Release cadence is irregular, with breaking changes in major versions.","status":"active","version":"11.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/Financial-Times/ft-poller","tags":["javascript"],"install":[{"cmd":"npm install ft-poller","lang":"bash","label":"npm"},{"cmd":"yarn add ft-poller","lang":"bash","label":"yarn"},{"cmd":"pnpm add ft-poller","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"HTTP client for making requests","package":"node-fetch","optional":true}],"imports":[{"note":"ESM-only since v11","wrong":"const Poller = require('ft-poller');","symbol":"Poller","correct":"import { Poller } from 'ft-poller'"},{"note":"Default export in older versions; check your version's export style.","wrong":"import { Poller } from 'ft-poller'","symbol":"Poller","correct":"import Poller from 'ft-poller'"},{"note":"TypeScript type, not a runtime value.","wrong":"import { Poller } from 'ft-poller'; const PollOptions = Poller.PollOptions;","symbol":"PollOptions","correct":"import type { PollOptions } from 'ft-poller'"}],"quickstart":{"code":"import { Poller } from 'ft-poller';\n\nconst poller = new Poller({\n  url: 'https://api.example.com/data',\n  interval: 60000,\n  method: 'GET',\n  headers: { 'Authorization': `Bearer ${process.env.API_KEY ?? ''}` }\n});\n\npoller.start();\n\npoller.on('data', (data) => {\n  console.log('Received data:', data);\n});\n\npoller.on('error', (err) => {\n  console.error('Polling error:', err);\n});\n\n// Stop after 5 minutes\nsetTimeout(() => poller.stop(), 300000);","lang":"typescript","description":"Creates a poller that fetches data every 60 seconds from an HTTPS endpoint with auth header."},"warnings":[{"fix":"Convert require() to import syntax. If using TypeScript, ensure moduleResolution is node16 or bundler.","message":"ESM-only in v11: CommonJS require() will break. Use import.","severity":"breaking","affected_versions":">=11.0.0"},{"fix":"Replace 'import Poller from \"ft-poller\"' with 'import { Poller } from \"ft-poller\"'.","message":"Using default export is deprecated in v10+. Prefer named import { Poller }","severity":"deprecated","affected_versions":">=10.0.0"},{"fix":"Update your constructor to pass an options object: new Poller({url: '...', interval: 60000}).","message":"Versions before 9.0.0 used a different constructor signature without options object.","severity":"gotcha","affected_versions":"<9.0.0"},{"fix":"Upgrade Node.js to 20.x LTS or 22.x.","message":"Node.js version must be 20.x or 22.x. Older versions will cause runtime errors.","severity":"gotcha","affected_versions":">=11.0.0"}],"env_vars":null,"search_vec":"'11.0.1':20 '20':26 '22':29 'break':68 'built':39 'built-in':38 'cach':11,41 'cadenc':64 'chang':69 'client':5 'current':16 'data':12 'differenti':45 'error':43 'fetch':9 'financi':60 'focus':53 'ft':1 'generic':48 'handl':44 'http':4,55 'infrastructur':62 'integr':58 'irregular':66 'javascript':73 'librari':6,50 'major':71 'mechan':36 'node.js':25 'period':8 'poll':35,49 'poller':2 'provid':32 'releas':21,63 'servic':15,56 'simpl':34 'stabl':17 'support':23 'time':61 'version':18,72 'web':14 'x':27,30","created_at":"2026-06-07T16:52:57.758156+00:00","updated_at":"2026-06-07T16:52:57.758156+00:00","problems":[{"fix":"Check package version. For v10+, use named import. For older versions, use 'import Poller from \"ft-poller\"'.","cause":"Using import { Poller } from 'ft-poller' but version exports default (v9 and earlier?).","error":"TypeError: ft_poller_1.Poller is not a constructor"},{"fix":"Run 'npm install node-fetch' or add it to your package.json.","cause":"Missing peer dependency node-fetch (required for HTTP requests).","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'node-fetch'"},{"fix":"Use 'import' syntax. If you must use require, downgrade to ft-poller@10.0.0 or earlier.","cause":"Running CommonJS (require) for an ESM-only package (v11+).","error":"node:internal/modules/cjs/loader:933 Module._throw err, SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Financial-Times/ft-poller","github":"https://github.com/Financial-Times/ft-poller","docs":null,"changelog":null,"pypi":null,"npm":"ft-poller","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}