{"id":13449798,"url":"https://github.com/mbasso/refraction-player","last_synced_at":"2025-10-04T13:32:45.339Z","repository":{"id":57352179,"uuid":"62747182","full_name":"mbasso/refraction-player","owner":"mbasso","description":"An events player for refraction","archived":false,"fork":false,"pushed_at":"2016-07-08T15:50:59.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T08:43:41.606Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbasso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-06T19:15:56.000Z","updated_at":"2023-03-10T09:45:23.000Z","dependencies_parsed_at":"2022-09-19T03:40:54.767Z","dependency_job_id":null,"html_url":"https://github.com/mbasso/refraction-player","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Frefraction-player","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Frefraction-player/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Frefraction-player/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Frefraction-player/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbasso","download_url":"https://codeload.github.com/mbasso/refraction-player/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246644095,"owners_count":20810687,"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-07-31T06:00:56.469Z","updated_at":"2025-10-04T13:32:45.281Z","avatar_url":"https://github.com/mbasso.png","language":"JavaScript","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"# Refraction Player\n\n[![Build Status](https://travis-ci.org/mbasso/refraction-player.svg?branch=master)](https://travis-ci.org/mbasso/refraction-player)\n[![npm version](https://img.shields.io/npm/v/refraction-player.svg)](https://www.npmjs.com/package/refraction-player)\n[![npm downloads](https://img.shields.io/npm/dm/refraction-player.svg?maxAge=2592000)](https://www.npmjs.com/package/refraction-player)\n[![Coverage Status](https://coveralls.io/repos/github/mbasso/refraction-player/badge.svg?branch=master)](https://coveralls.io/github/mbasso/refraction-player?branch=master)\n\n\u003e An events player for refraction\n\nRefraction Player is a small library that allow you to play a list of events with refraction. [Here](https://mbasso.github.io/refraction/docs/basics/Replay.html) you can see its idea. Refraction Player can be used to automate some process, testing and debugging. If we want to test something we can prepare a series of events and use Refraction Player to play them in order to see how our application react to these events. If we want to find a bug after an application crash, we can send Refraction history to our server and replay events to identify the problem. Finally if we want to automate some process, we can prepare a list of events and play them to achieve this result.\nFor example, we can create an automatic tutorial for application using this tool.\n\n## Installation\n\nYou can install Refraction Player using [npm](https://www.npmjs.com/package/refraction-player):\n\n```bash\nnpm install --save refraction-player\n```\n\nIf you aren't using npm in your project, you can include RefractionPlayer using UMD build in the dist folder with `\u003cscript\u003e` tag.\n\n## Usage\n\nRefraction Player export only one function to achieve its purpose. You can import it in this way:\n\n```js\nimport play from 'refraction-player';\n```\n\nAt this point `play` is a function that returns nothing and accept an object with these properties as parameter:\n\n|Property   |Type   |Default   |Description   |\n|-----------|-------|----------|--------------|\n| refraction | Refraction |  | Refraction instance that refraction-player uses to publish events |\n| track | Array of `{ channel: String, time: number(ms), param: any }` | [] | Array of objects that specify on which channel publish the payload. `time` property indicate the timestap of the event, time between two events is calulated as follow: secondTime - firstTime = delay |\n| exclude | Array of channels | [] | Array of channels that will be ignored |\n| delay | number (milliseconds) | 200 | Constant number of milliseconds that will pass between two publications. This is used only if `ignoreTime` is true or `time` property is null or undefined |\n| ignoreTime | boolean | false | Indicate if refraction-player must use `delay` or not. If false refraction-player will use `time` property in payload |\n\n**N.B.** When you use this function you have to pay attention at middlewares. Consider that middlewares will be applied to your messages, so, if you get them from history, you have to be sure that middlewares have some checks that avoid unwanted transformations.\n\n## Examples\n\nYou can find an example of Refraction Player in Refraction repository [here](). Alternatively, you can check [awesome-refraction](https://github.com/mbasso/awesome-refraction).\n\nIf you want to run examples, check out the instruction [here](https://mbasso.github.io/refraction/docs/introduction/Examples.html).\n\n## Change Log\n\nThis project adheres to [Semantic Versioning](http://semver.org/).  \nEvery release, along with the migration instructions, is documented on the Github [Releases](https://github.com/mbasso/refraction-player/releases) page.\n\n## Authors\n**Matteo Basso**\n- [github/mbasso](https://github.com/mbasso)\n- [@Teo_Basso](https://twitter.com/Teo_Basso)\n\n**Adriano Buscema**\n- [github/adribusc](https://github.com/adribusc)\n\n## Copyright and License\nCopyright (c) 2016, Matteo Basso.\n\nrefraction-player source code is licensed under the [MIT License](https://github.com/mbasso/refraction-player/blob/master/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbasso%2Frefraction-player","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbasso%2Frefraction-player","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbasso%2Frefraction-player/lists"}