{"id":40481879,"url":"https://github.com/e280/sten","last_synced_at":"2026-01-20T18:33:20.487Z","repository":{"id":294762780,"uuid":"987953722","full_name":"e280/sten","owner":"e280","description":"🖋️ typescript logging","archived":false,"fork":false,"pushed_at":"2025-08-06T23:34:01.000Z","size":123,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T09:14:37.412Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/e280.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2025-05-21T20:48:45.000Z","updated_at":"2025-08-18T04:24:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"0025c29e-b361-476f-85d3-49f86523c3c4","html_url":"https://github.com/e280/sten","commit_stats":null,"previous_names":["e280/sten"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/e280/sten","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e280%2Fsten","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e280%2Fsten/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e280%2Fsten/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e280%2Fsten/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e280","download_url":"https://codeload.github.com/e280/sten/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e280%2Fsten/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28609120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: 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":[],"created_at":"2026-01-20T18:33:20.412Z","updated_at":"2026-01-20T18:33:20.477Z","avatar_url":"https://github.com/e280.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![](https://i.imgur.com/TTZbq3k.jpeg)\n\n# 🖋️ @e280/sten\n- logging utility\n- zero dependencies\n- *an https://e280.org/ project*\n\n\u003cbr/\u003e\n\n## quick start\n- install sten\n  ```sh\n  npm install @e280/sten\n  ```\n- make your logger\n  ```ts\n  import {Logger} from \"@e280/sten\"\n  export const logger = new Logger()\n  ```\n- log stuff\n  ```ts\n  await logger.log(\"hello world!\")\n  await logger.error(\"bad stuff\", new Error(\"oh no!\"))\n  ```\n  ![](https://i.imgur.com/FeYnEvc.png)\n\n### customize the logger\n```ts\n// defaults shown\nexport const logger = new Logger()\n  .setWriter(Logger.writers.auto())\n  .setColors(Logger.colors.auto())\n  .setTheme(Logger.themes.auto())\n  .setShaper(Logger.shapers.auto())\n```\n\n### writers\nthe logger ultimately emits to stdout or stderr via a writer — the available writers are:\n- `auto` — *(default)* detect environment and automatically choose `deno`, `node`, or `console`\n- `console` — outputs to console.log and console.error\n- `node` — outputs to process.stdout and process.stderr\n- `deno` — outputs to Deno.stdout and Deno.stderr\n- `void` — outputs nothing\n\n### colors\ndetermines what happens when colors are used — available colors are:\n- `auto` — *(default)* use color if it looks like we're in a color-supporting environment\n- `colorful` — full ansi color support\n- `colorless` — no colors (all color fns are duds)\n\n### themes\ndefines where certain colors will be used:\n- `auto` — *(default)* uses the basic theme (in the future this might auto-detect from an env var)\n- `basic` — standard colors, red errors, blue timestamps, etc\n\n### shapers\na shaper is a fn that transforms the content before it is logged — the available shapers are:\n- `auto` — *(default)* standard setup which combines `errors` and `timestamp` together\n- `errors` — displays error objects nicely\n- `timestamp` — attaches a timestamp prefix to every message\n- `none` — does nothing (leaves content as-is)\n\nyou can make your own shaper like this:\n```ts\nimport {asShaper} from \"@e280/sten\"\n\nconst myShaper = asShaper(context =\u003e ({\n  stdout: items =\u003e items,\n  stderr: items =\u003e items,\n}))\n```\n\nyou can apply multiple shapers together like this:\n```ts\nlogger.setShaper(\n  myShaper,\n  myOtherCustomShaper,\n  Logger.shapers.errors(),\n  Logger.shapers.timestamps(),\n)\n```\n\nor you can use `combineShapers`\n```ts\nimport {combineShapers} from \"@e280/sten\"\n\nconst megaShaper = combineShapers(\n  myShaper,\n  myOtherCustomShaper,\n  Logger.shapers.errors(),\n  Logger.shapers.timestamps(),\n)\n```\n\n\u003cbr/\u003e\n\n## 💖 made with open source love\nbuild with us at https://e280.org/ but only if you're cool\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe280%2Fsten","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe280%2Fsten","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe280%2Fsten/lists"}