{"id":16663844,"url":"https://github.com/jonathanj/eliot.js","last_synced_at":"2025-08-05T12:16:26.035Z","repository":{"id":149213940,"uuid":"67807970","full_name":"jonathanj/eliot.js","owner":"jonathanj","description":"Eliot for Javascript","archived":false,"fork":false,"pushed_at":"2016-09-12T13:44:11.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T08:53:19.987Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jonathanj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-09T14:57:13.000Z","updated_at":"2016-09-09T15:01:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"36534383-b05e-4c7a-a73f-fa7c7fd1eea6","html_url":"https://github.com/jonathanj/eliot.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanj%2Feliot.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanj%2Feliot.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanj%2Feliot.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanj%2Feliot.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathanj","download_url":"https://codeload.github.com/jonathanj/eliot.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243307333,"owners_count":20270256,"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-10-12T10:42:18.214Z","updated_at":"2025-03-12T22:41:50.072Z","avatar_url":"https://github.com/jonathanj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eliot.js\n\nAn [Eliot](https://github.com/ClusterHQ/eliot) port for Javascript.\n\nEliot is a logging system that outputs causal chains of actions happening within\nand across application boundaries: a logical trace of a system's operation.\n\n\n## Installation\n\n```shell\n$ npm install eliot\n```\n\n## Usage\n\n```es6\nconst {withAction, ActionType, fields, addDestination} = require('eliot'),\n      messages = [],\n      removeDestination = addDestination(x =\u003e messages.push(x))\n\nconst LOG_DOSOMETHING = ActionType(\n  'app:system:dosomething',\n  fields({key: 'number'}),\n  fields({result: 'string'}),\n  'Do something with a key, resulting in a value')\n  \nfunction doSomething(key) {\n  withAction(LOG_DOSOMETHING({key}), action =\u003e {\n    const result = doTheThing(key)\n    action.addSuccessFields({result})\n    return result\n  })\n}\n\nremoveDestination()\n```\n\nWhich would result in `messages` being populated with:\n\n```json\n[ { \"key\": 999,\n    \"action_status\": \"started\",\n    \"task_uuid\": \"eabe6f5a-f677-439d-aea7-659e2dab6efc\",\n    \"action_type\": \"app:system:dosomething\",\n    \"timestamp\": 1473622530.867,\n    \"task_level\": [ 1 ] },\n  { \"result\": 42,\n    \"action_status\": \"succeeded\",\n    \"task_uuid\": \"eabe6f5a-f677-439d-aea7-659e2dab6efc\",\n    \"action_type\": \"app:system:dosomething\",\n    \"timestamp\": 1473622530.867,\n    \"task_level\": [ 2 ] } ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanj%2Feliot.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanj%2Feliot.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanj%2Feliot.js/lists"}