{"id":13793476,"url":"https://github.com/okwolf/hyperapp-logger","last_synced_at":"2025-05-12T20:31:04.988Z","repository":{"id":44620207,"uuid":"101540877","full_name":"okwolf/hyperapp-logger","owner":"okwolf","description":"Log Hyperapp state updates and action information to the console.","archived":false,"fork":false,"pushed_at":"2022-02-04T06:34:26.000Z","size":72,"stargazers_count":47,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-01T17:02:28.587Z","etag":null,"topics":["console","hyperapp","logger"],"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/okwolf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-27T08:57:52.000Z","updated_at":"2023-02-11T20:20:24.000Z","dependencies_parsed_at":"2022-09-01T03:50:27.201Z","dependency_job_id":null,"html_url":"https://github.com/okwolf/hyperapp-logger","commit_stats":null,"previous_names":["hyperapp/logger"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okwolf%2Fhyperapp-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okwolf%2Fhyperapp-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okwolf%2Fhyperapp-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okwolf%2Fhyperapp-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okwolf","download_url":"https://codeload.github.com/okwolf/hyperapp-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253816695,"owners_count":21968869,"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":["console","hyperapp","logger"],"created_at":"2024-08-03T23:00:22.050Z","updated_at":"2025-05-12T20:31:04.661Z","avatar_url":"https://github.com/okwolf.png","language":"JavaScript","readme":"# Hyperapp Logger\n\n[![Build Status](https://github.com/okwolf/hyperapp-logger/actions/workflows/ci.yml/badge.svg)](https://github.com/okwolf/hyperapp-logger/actions)\n[![Codecov](https://img.shields.io/codecov/c/github/okwolf/hyperapp-logger/master.svg)](https://codecov.io/gh/okwolf/hyperapp-logger)\n[![npm](https://img.shields.io/npm/v/hyperapp-logger.svg?maxAge=2592000?style=plastic)](https://www.npmjs.com/package/hyperapp-logger)\n\nA [Hyperapp](https://github.com/hyperapp/hyperapp) [dispatch initializer](https://github.com/jorgebucaran/hyperapp/blob/main/docs/architecture/dispatch.md#dispatch-initializer) that logs state updates and action information to the console.\n\n## Getting Started\n\nThis example shows a counter that can be incremented or decremented. Go ahead and [try it online](https://codepen.io/okwolf/pen/xLQmvW?editors=0010) with your browser console open to see the log messages.\n\n```jsx\nimport { app } from \"hyperapp\";\nimport logger from \"hyperapp-logger\";\n\nconst Up = state =\u003e state + 1;\nconst Down = state =\u003e state - 1;\n\napp({\n  init: 0,\n  view: state =\u003e (\n    \u003cmain\u003e\n      \u003ch1\u003e{state.count}\u003c/h1\u003e\n      \u003cbutton onclick={Down}\u003eー\u003c/button\u003e\n      \u003cbutton onclick={Up}\u003e＋\u003c/button\u003e\n    \u003c/main\u003e\n  ),\n  node: document.getElementById(\"app\"),\n  dispatch: logger\n});\n```\n\n![Screenshot](https://user-images.githubusercontent.com/3735164/152481590-d18dc32a-71fa-47da-8606-742bc6fc42b1.png)\n\n## Installation\n\n### Node.js\n\nInstall with npm / Yarn.\n\n\u003cpre\u003e\nnpm i \u003ca href=\"https://www.npmjs.com/package/hyperapp-logger\"\u003ehyperapp-logger\u003c/a\u003e\n\u003c/pre\u003e\n\nThen with a module bundler like [rollup](https://github.com/rollup/rollup) or [webpack](https://github.com/webpack/webpack) use as you would anything else.\n\n```js\nimport logger from \"hyperapp-logger\";\n```\n\n### Browser\n\nDownload the minified library from the [CDN](https://unpkg.com/hyperapp-logger).\n\n```html\n\u003cscript src=\"https://unpkg.com/hyperapp-logger\"\u003e\u003c/script\u003e\n```\n\nYou can find the library in `window.hyperappLogger`.\n\n## Usage\n\n```js\nimport logger from \"hyperapp-logger\";\n\napp({\n  init,\n  view,\n  node,\n  dispatch: logger\n});\n\n// Or if you need to pass options\napp({\n  init,\n  view,\n  node,\n  dispatch: logger(options)\n});\n```\n\n### Options\n\n#### `options.log`\n\nUse it to customize the log function.\n\n```js\napp({\n  init,\n  view,\n  node,\n  dispatch: logger({\n    log(state, action, props, actionResult) {\n      // format and send your log messages anywhere you like\n    }\n  })\n});\n```\n\n## License\n\nHyperapp Logger is MIT licensed. See [LICENSE](LICENSE.md).\n","funding_links":[],"categories":["Utilities V1"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokwolf%2Fhyperapp-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokwolf%2Fhyperapp-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokwolf%2Fhyperapp-logger/lists"}