{"id":19680621,"url":"https://github.com/oakserver/commons","last_synced_at":"2025-04-29T04:31:34.381Z","repository":{"id":57675615,"uuid":"442931158","full_name":"oakserver/commons","owner":"oakserver","description":"A set of APIs for handling HTTP and HTTPS requests with Deno 🐿️ 🦕","archived":false,"fork":false,"pushed_at":"2024-03-05T00:04:49.000Z","size":94,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T14:59:20.249Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://deno.land/x/oak_commons","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oakserver.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-12-30T01:11:14.000Z","updated_at":"2024-04-16T00:24:21.314Z","dependencies_parsed_at":"2024-04-16T00:34:21.391Z","dependency_job_id":null,"html_url":"https://github.com/oakserver/commons","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"dc7bf21cecfffd43b9b309e9e607458aebed9061"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakserver%2Fcommons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakserver%2Fcommons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakserver%2Fcommons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakserver%2Fcommons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oakserver","download_url":"https://codeload.github.com/oakserver/commons/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251432834,"owners_count":21588664,"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-11-11T18:05:34.921Z","updated_at":"2025-04-29T04:31:33.483Z","avatar_url":"https://github.com/oakserver.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oak commons\n\n[![jsr.io/@oak/commons](https://jsr.io/badges/@oak/commons)](https://jsr.io/@oak/commons)\n[![jsr.io/@oak/commons score](https://jsr.io/badges/@oak/commons/score)](https://jsr.io/@oak/commons)\n[![deno.land/x/oak_commons](https://deno.land/badge/oak_commons/version)](https://deno.land/x/oak_commons)\n\n[![ci](https://github.com/oakserver/commons/workflows/ci/badge.svg)](https://github.com/oakserver/commons)\n[![codecov](https://codecov.io/gh/oakserver/commons/graph/badge.svg?token=zImXfOXhO2)](https://codecov.io/gh/oakserver/commons)\n\nA set of APIs that are common to HTTP/HTTPS servers.\n\n\u003e [!NOTE]\n\u003e Originally most of this code was contributed to the Deno standard library but\n\u003e the maintainers after accepting the contributions have moved to remove this\n\u003e code, so I had to resurrect this library to be able to provide common HTTP\n\u003e functionality.\n\nEach module is designed to be largely independent of other modules, with as few\nshared dependencies as reasonable. These modules are designed as building blocks\nfor more complex HTTP/HTTPS and server frameworks.\n\nThe [acorn](https://deno.land/x/acorn) (a RESTful services framework) and\n[oak](https://jsr.io/@oak/oak) are examples of something built on top of\noak commons.\n\n## Usage\n\nEach module/export is designed to be as independent as possible and there is no\ntop level export, so each area of functionality needs to be imported. For\nexample, to use `status` would look something like this:\n\n```ts\nimport { STATUS_CODE, STATUS_TEXT } from \"jsr:@oak/commons/status\";\n\nconsole.log(STATUS_CODE.NotFound); // Returns 404\nconsole.log(STATUS_TEXT[STATUS_CODE.NotFound]); // Returns \"Not Found\"\n```\n\n## Documentation\n\nThe\n[inline documentation](https://jsr.io/@oak/commons)\nfor each modules is the best guide on the usage of the APIs:\n\n- [/assert](https://jsr.io/@oak/commons/doc/cookie_map/~) - an assertion\n  function that throws HTTP errors when the assertion fails.\n- [/cookie_map](https://jsr.io/@oak/commons/doc/cookie_map/~) - an API for\n  managing signed and unsigned cookies server side.\n- [/form_data](https://jsr.io/@oak/commons/doc/form_data/~) - the ability to\n  parse a stream body into `FormData` when this functionality isn't available\n  in the runtime.\n- [/forwarded](https://jsr.io/@oak/commons/doc/forwarded/~) - a parser for\n  the `Forwarded` header vale.\n- [/http_errors](https://jsr.io/@oak/commons/doc/http_errors/~) - utilities\n  for working with HTTP Error status as JavaScript errors.\n- [/keystack](https://jsr.io/@oak/commons/doc/keystack/~) - a key ring\n  implementation to allow for management of rotating encryption keys.\n- [/media_types](https://jsr.io/@oak/commons/doc/media_types/~) - utilities\n  for working with media types from a request.\n- [/method](https://jsr.io/@oak/commons/doc/method/~) - utilities for working\n  with HTTP methods/verbs in a type safe way.\n- [/range](https://jsr.io/@oak/commons/doc/range/~) - utilities for\n  supporting range requests.\n- [/server_sent_event](https://jsr.io/@oak/commons/doc/server_sent_event/~) -\n  an abstraction for managing server sent events like DOM events.\n- [/status](https://jsr.io/@oak/commons/doc/status/~) - utilities for working\n  with HTTP statuses in a type safe way.\n\n---\n\nCopyright 2018 - 2024 the oak authors. All rights reserved. MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foakserver%2Fcommons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foakserver%2Fcommons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foakserver%2Fcommons/lists"}