{"id":21166010,"url":"https://github.com/peterdee/node-als-example","last_synced_at":"2026-04-08T18:01:31.333Z","repository":{"id":103803803,"uuid":"327622079","full_name":"peterdee/node-als-example","owner":"peterdee","description":"An example of the Async Local Storage usage in Node","archived":false,"fork":false,"pushed_at":"2021-01-07T14:29:52.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2026-01-03T15:33:36.023Z","etag":null,"topics":["als","async-hooks","async-local-storage","express","jest","nodejs"],"latest_commit_sha":null,"homepage":"http://localhost:2121","language":"JavaScript","has_issues":false,"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/peterdee.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":"2021-01-07T13:36:11.000Z","updated_at":"2021-01-07T14:33:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2def98b-a8d9-4530-97a2-c9f848eab008","html_url":"https://github.com/peterdee/node-als-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/peterdee/node-als-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdee%2Fnode-als-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdee%2Fnode-als-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdee%2Fnode-als-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdee%2Fnode-als-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterdee","download_url":"https://codeload.github.com/peterdee/node-als-example/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdee%2Fnode-als-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31567227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["als","async-hooks","async-local-storage","express","jest","nodejs"],"created_at":"2024-11-20T14:47:53.359Z","updated_at":"2026-04-08T18:01:31.315Z","avatar_url":"https://github.com/peterdee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## node-als-example\n\n[![Build Status](https://travis-ci.com/peterdee/node-als-example.svg?branch=develop)](https://travis-ci.com/peterdee/node-als-example)\n\nAn example of how the [Async Local Storage (ALS)](https://nodejs.org/api/async_hooks.html#async_hooks_class_asynclocalstorage) from [`async_hooks`](https://nodejs.org/api/async_hooks.html) can be utilized.\n\nThe application is a basic [Express](http://expressjs.com) server that writes data into the ALS in the middleware and then reads data from ALS in the API handler.\n\n### Deploy\n\n```shell script\ngit clone https://github.com/peterdee/node-als-example\ncd ./node-als-example\nnvm use 14\nnpm i\n```\n\n### Launch\n\n```shell script\nnpm start\n```\n\nThe app will be launched at http://localhost:2121, a different port can be specified with the `PORT` environment variable.\n\n### APIs\n\n- `/` - `[GET]` - get a response with a unique identifier\n- `/delayed` - `[GET]` - get delayed response (accessing ALS inside the `setTimeout`)\n\n### Tests\n\n```shell script\nnpm run test\n```\n\n### Linting\n\n```shell script\nnpm run lint\n```\n\n### License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterdee%2Fnode-als-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterdee%2Fnode-als-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterdee%2Fnode-als-example/lists"}