{"id":13528750,"url":"https://github.com/daikon-games/gm-stream","last_synced_at":"2026-02-23T06:42:46.155Z","repository":{"id":115474165,"uuid":"305809145","full_name":"daikon-games/gm-stream","owner":"daikon-games","description":"A Stream implementation for GameMaker Studio 2.3+, allowing fluent APIs to manipulate various data structures","archived":false,"fork":false,"pushed_at":"2022-03-02T15:30:17.000Z","size":308,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-02T15:36:17.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Game Maker Language","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daikon-games.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"daikon-games","patreon":"nickavv"}},"created_at":"2020-10-20T19:11:13.000Z","updated_at":"2024-10-16T08:09:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f64e602-13b0-4ef2-8b49-95921d18269c","html_url":"https://github.com/daikon-games/gm-stream","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daikon-games%2Fgm-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daikon-games%2Fgm-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daikon-games%2Fgm-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daikon-games%2Fgm-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daikon-games","download_url":"https://codeload.github.com/daikon-games/gm-stream/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246655242,"owners_count":20812605,"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-08-01T07:00:23.800Z","updated_at":"2026-02-23T06:42:46.124Z","avatar_url":"https://github.com/daikon-games.png","language":"Game Maker Language","funding_links":["https://github.com/sponsors/daikon-games","https://patreon.com/nickavv"],"categories":["Data Manipulation"],"sub_categories":["Recommendations"],"readme":"## Meet gm-stream!\n![Header](images/header-wide.png)\n**gm-stream** provides a series of fluent APIs that can aid in performing powerful logic on data structures. gm-stream is heavily based on the concept of [Streams](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html) from the Java programming language, although it has been adapted to suit GameMaker Language.\n\nUse of **gm-stream** requires GameMaker 2.3 or higher, as it makes use of many of that release's new language functions.\n\n## Get gm-stream\n### Manual Package Installation\nYou can download the latest release of **gm-stream** from the [GitHub Releases page](https://github.com/daikon-games/gm-stream/releases), or from our [itch.io page](https://nickavv.itch.io/gm-stream).\n\nOnce you have downloaded the the package, in GameMaker Studio click on the **Tools** menu and select **Import Local Package**. Choose the `.yymps` file you downloaded, and import all assets.\n\n### GameMaker Marketplace\n**gm-stream** can be downloaded directly from the GameMaker Marketplace. Simply visit the [Marketplace page](https://marketplace.yoyogames.com/assets/9500/gm-stream) and click the **Add to Account** button.\n\n## Using gm-stream\n### stream_of(dataStructure)\nBefore you can use **gm-stream**'s APIs you must create a `GmStream` from an existing data structure. Do this by calling the `stream_of` global function:\n```\nvar myArray = [1, 2, 3, 4, 5];\nvar stream = stream_of(myArray);\n```\nThe types of data structures that `stream_of` can handle are as follows:\n* `array`\n* `ds_list`\n* `ds_queue`\n* `ds_stack`\n\nPassing any other type of data structures to `stream_of` will throw an error.\n\nOnce you have a `GmStream` instance you can manipulate it in a lot of different ways. **Intermediate Operations** will modify the stream's data in some way, and then return the same stream instance so you can chain calls together. **Terminal Operations** collect the data of the stream into some final result and return that, cleaning up the `GmStream` instance.\n\nA summary of all the available Intermediate and Terminal operations is below, but full descriptions of each with example code can be found in the [API Guide](API.md).\n\n### Intermediate Operations\n#### [.distinct()](API.md#distinct)\nRemoves all duplicate items from the stream\n\n#### [.filter(predicateFunction)](API.md#filterpredicatefunction)\nRemoves items from the stream which match the provided predicate function\n\n#### [.map(mapFunction)](API.md#mapmapfunction)\nApplies the provied map function to each item in the stream\n\n#### [.sort([comparatorFunction])](API.md#sortcomparatorFunction)\nSorts the items in the stream according to the provided comparator function (optional).\n\nIf no comparator function is provided it will perform a `ds_list_sort` in the ascending direction on the data.\nThis is appropriate for sorting a stream of Strings alphabetically or a stream of numbers numerically, but for more complex\ncases, providing a comparator yourself is recommended.\n\n### Terminal Operations\n#### [.allMatch(predicateFunction)](API.md#allmatchpredicatefunction)\nReturns true if every item in the stream matches the provided predicate function, false if one or more items does not match.\n\n#### [.anyMatch(predicateFunction)](API.md#anymatchpredicatefunction)\nReturns true if one or more items in the stream match the provided predicate function, false if every item does not match it.\n\n#### [.collectAsArray()](API.md#collectasarray)\nReturns an array containing the items of the stream in their current order\n\n#### [.collectAsList()](API.md#collectaslist)\nReturns a `ds_list` containing the items of the stream in their current order\n\n#### [.collectJoining([delimiter], [prefix], [suffix])](API.md#collectjoiningdelimiter-prefix-suffix)\nReturns a string consisting of the items of the stream (passed through GameMaker's `string` function) concatenated.\n\nOptional parameters `delimiter`, `prefix`, and `suffix` allow for the items to be separated by the given delimiter, and the entire string to be prefixed and suffixed by the given prefix and suffix.\n\n#### [.count()](API.md#count)\nReturns the number of items in the stream\n\n#### [.findFirst()](API.md#findFirst)\nReturns the first item encountered in the stream, or `noone` if the stream is empty\n\n#### [.fold(initialValue, foldFunction)](API.md#foldinitialvalue-foldfunction)\nStarting with the initial value, performs the provided fold function on each item in the stream to\ncombine them into some final result.\n\n#### [.forEach(forEachFunction)](API.md#foreachforeachfunction)\nExecutes the provided function across each item in the stream.\n\n#### [.noneMatch(predicateFunction)](API.md#nonematchpredicatefunction)\nReturns true if no items in the stream match the provided predicate function, false if one or more items do match it.\n\n#### [.reduce(foldFunction)](API.md#reducefoldfunction)\nA variation of `fold` which takes the first item encountered in the stream and uses it as the\ninitial value for the folding operation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaikon-games%2Fgm-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaikon-games%2Fgm-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaikon-games%2Fgm-stream/lists"}