{"id":21042568,"url":"https://github.com/osmlab/osm-stream","last_synced_at":"2025-05-15T17:30:44.444Z","repository":{"id":7442609,"uuid":"8783628","full_name":"osmlab/osm-stream","owner":"osmlab","description":"Minutely clientside OpenStreetMap changeset streams","archived":false,"fork":false,"pushed_at":"2023-04-15T11:26:42.000Z","size":175,"stargazers_count":19,"open_issues_count":2,"forks_count":7,"subscribers_count":7,"default_branch":"gh-pages","last_synced_at":"2025-04-18T12:10:01.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/osmlab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2013-03-14T19:33:04.000Z","updated_at":"2025-04-04T00:53:21.000Z","dependencies_parsed_at":"2023-01-13T14:23:14.617Z","dependency_job_id":null,"html_url":"https://github.com/osmlab/osm-stream","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/osmlab%2Fosm-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmlab%2Fosm-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmlab%2Fosm-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmlab%2Fosm-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osmlab","download_url":"https://codeload.github.com/osmlab/osm-stream/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254388036,"owners_count":22062971,"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-11-19T14:06:01.216Z","updated_at":"2025-05-15T17:30:44.095Z","avatar_url":"https://github.com/osmlab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## OSM Stream\n\nUses the [Overpass API](http://overpass-api.de/) for\n[Augmented Diffs](http://wiki.openstreetmap.org/wiki/Overpass_API/Augmented_Diffs),\nloads data with CORS and exposes a stream.\n\n## using\n\nWithout browserify: copy `osmstream.js`. That works as an `osmStream` global\nand with UMD.\n\nWith browserify `npm install osm-stream`\n\n## api\n\n`s.once(function(err, data) { }, [bbox])`\n\nGet one batch of changes right now.\n\n`s.run(function(err, stream), duration, [dir], [bbox], [maxRetries])`\n\nduration is how long between runs: default 1 minute\n\ndir is direction: either `1`, the default, or `-1` for rewind.\n\nmaxRetries: How often to retry fetching the current diff before skipping it.\n\n`s.runFn(function(err, stream), duration, [dir], [bbox], [maxRetries])`\n\nSame as `.run` but instead of returning a stream that pipes objects, calls\nthe callback once per object.\n\nduration is how long between runs: default 1 minute\n\ndir is direction: either `1`, the default, or `-1` for rewind.\n\nmaxRetries: How often to retry fetching the current diff before skipping it.\n\n## example\n\n```js\nvar osmStream = require('osm-stream');\n\n// re-request every 60s\nosmStream\n    .run(function(err, stream) {\n        stream.on('data', function(d) {\n            console.log(d);\n        });\n    });\n\n// re-request every 60s\n// callback-style interface\nosmStream\n    .runFn(function(err, data) {\n        // ...\n    });\n\n// one-time request\nosmStream\n    .once(function(err, d) {\n        console.log(d);\n    });\n```\n\nThe stream returned uses [through](https://github.com/dominictarr/through), so\nyou can end it and that will also stop the run cycle.\n\n### See Also\n\n* [osm-stream-process](https://github.com/iandees/osm-stream-process) in Python\n\n### As Seen\n\n* [Show Me The Way](http://osmlab.github.io/show-me-the-way/) [source](https://github.com/osmlab/show-me-the-way)\n* [OSM Live Map](http://osmlab.github.io/osm-live-map/) [source](https://github.com/osmlab/osm-live-map)\n* [OSMBuzz](http://spatialbit.com/osmbuzz/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosmlab%2Fosm-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosmlab%2Fosm-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosmlab%2Fosm-stream/lists"}