{"id":16879449,"url":"https://github.com/purefunctor/purescript-pretty-logs","last_synced_at":"2025-06-25T02:33:13.794Z","repository":{"id":110141762,"uuid":"353191846","full_name":"purefunctor/purescript-pretty-logs","owner":"purefunctor","description":"Type-safe prettified console.log for PureScript.","archived":false,"fork":false,"pushed_at":"2021-03-31T15:31:58.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-01-25T04:44:44.937Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PureScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/purefunctor.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}},"created_at":"2021-03-31T01:45:17.000Z","updated_at":"2021-03-31T15:31:42.000Z","dependencies_parsed_at":"2023-03-13T13:57:59.945Z","dependency_job_id":null,"html_url":"https://github.com/purefunctor/purescript-pretty-logs","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"7d1f3d8977a0a2e8af8b5cbaf07e557b6898d53a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purefunctor%2Fpurescript-pretty-logs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purefunctor%2Fpurescript-pretty-logs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purefunctor%2Fpurescript-pretty-logs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purefunctor%2Fpurescript-pretty-logs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/purefunctor","download_url":"https://codeload.github.com/purefunctor/purescript-pretty-logs/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244513021,"owners_count":20464590,"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-13T15:54:25.068Z","updated_at":"2025-03-19T21:42:20.813Z","avatar_url":"https://github.com/purefunctor.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# purescript-pretty-logs\nType-safe prettified `console.log` for PureScript, derived from [safe-printf](https://github.com/kcsongor/purescript-safe-printf).\n\n## Introduction\n`pretty-logs` provides a type-safe interface for creating prettified and formatted `console.log` messages on browsers. For example:\n```purescript\nlogBlack :: String -\u003e Effect Unit\nlogBlack = logPretty \u003c\u003c\u003c logBlack_\n  where\n    mkBlackSpec :: CSS -\u003e String -\u003e LogSpec\n    mkBlackSpec = mkLogSpec ( Proxy :: _ \"%c %s\" )\n    -- [1] `mkLogSpec` creates a variadic function resulting in a `LogSpec`.\n    --\n    --     In this case, the type-level symbol \"%c %s\" produces a function\n    --     that takes a `CSS` and a `String`.\n    --\n    --     Note that regardless of the ordering of the format specifiers,\n    --     `CSS` arguments are always emitted first in order to support\n    --     partial function application in a clean manner.\n    logBlack_ :: String -\u003e LogSpec\n    logBlack_ =\n      mkBlackSpec ( CSS \"background-color: black; color: white;\" )\n    -- [2] You can then partially apply `mkBlackSpec` with inline CSS\n    --     styling to create a function that can be composed with `logPretty`.\n\nmain :: Effect Unit\nmain = do\n  logBlack \"In the beginning, there was silence...\"\n```\nIt is also possible to use `pretty-logs` with an unchecked `LogSpec` for simpler usages:\n```purescript\nlogSimple :: String -\u003e Effect Unit\nlogSimple m = logPretty\n  { message: \"%c \" \u003c\u003e m\n  , styling: [ CSS \"background-color: black; color: white;\" ]\n  }\n\nmain :: Effect Unit\nmain = do\n  logSimple \"Types are pretty nice, but simplicity is also good.\"\n```\n\n## Installation\n```sh\n$ spago install pretty-logs\n```\nor if not present within a package set, add the following to your project's `packages.dhall`:\n```dhall\nlet upstream =\n      ... \n\nin  upstream\n      with pretty-logs =\n        { repo \"https://github.com/PureFunctor/purescript-pretty-logs\"\n        , dependencies =\n          [ \"console\"\n          , \"effect\"\n          , \"newtype\"\n          , \"prelude\"\n          ]\n        , version = \"...\"\n        }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurefunctor%2Fpurescript-pretty-logs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurefunctor%2Fpurescript-pretty-logs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurefunctor%2Fpurescript-pretty-logs/lists"}