{"id":15063893,"url":"https://github.com/dmjio/servant-wasm","last_synced_at":"2025-04-10T11:26:28.362Z","repository":{"id":56877691,"uuid":"264530598","full_name":"dmjio/servant-wasm","owner":"dmjio","description":"Servant support for delivering WebAssembly","archived":false,"fork":false,"pushed_at":"2024-12-14T00:51:14.000Z","size":12,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T09:28:52.881Z","etag":null,"topics":["haskell","servant","wasm"],"latest_commit_sha":null,"homepage":"https://hackage.haskell.org/package/servant-wasm","language":"Haskell","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/dmjio.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}},"created_at":"2020-05-16T21:28:16.000Z","updated_at":"2024-12-14T00:51:18.000Z","dependencies_parsed_at":"2025-02-17T04:31:56.792Z","dependency_job_id":"b7e2eccf-1bed-4ed9-b585-119a5eec839b","html_url":"https://github.com/dmjio/servant-wasm","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/dmjio%2Fservant-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmjio%2Fservant-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmjio%2Fservant-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmjio%2Fservant-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmjio","download_url":"https://codeload.github.com/dmjio/servant-wasm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208621,"owners_count":21065203,"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":["haskell","servant","wasm"],"created_at":"2024-09-25T00:08:30.515Z","updated_at":"2025-04-10T11:26:28.345Z","avatar_url":"https://github.com/dmjio.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"servant-wasm\n==========================\n[![Hackage](https://img.shields.io/hackage/v/servant-wasm.svg)](http://hackage.haskell.org/package/servant-wasm)\n[![Haskell Programming Language](https://img.shields.io/badge/language-Haskell-green.svg)](https://haskell.org)\n[![BSD3 LICENSE](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/dmjio/servant-wasm/blob/master/LICENSE)\n[![Build Status](https://travis-ci.org/dmjio/servant-wasm.svg?branch=master)](https://travis-ci.org/dmjio/servant-wasm)\n\nContent-Type support for delivering WASM with [servant](https://github.com/haskell-servant/servant)\n\n### Usage\n\n```haskell\n{-# LANGUAGE DataKinds         #-}\n{-# LANGUAGE TypeOperators     #-}\n{-# LANGUAGE TypeApplications  #-}\n{-# LANGUAGE OverloadedStrings #-}\nmodule Main where\n\nimport           Control.Monad.IO.Class     (liftIO)\nimport qualified Data.ByteString            as B\nimport           Data.ByteString            (ByteString)\nimport           Data.Proxy                 (Proxy (Proxy))\nimport           Network.Wai.Handler.Warp   (run)\nimport           Servant.Server             (serve, Handler)\nimport           Servant.API                ((:\u003e), Get)\nimport           Servant.WASM               (WASM)\n\ntype API = \"wasm\" :\u003e Get '[WASM] ByteString\n\nmain :: IO ()\nmain = do\n  putStrLn \"Running on 3000...\"\n  run 3000 (serve (Proxy @ API) wasmHandler)\n\nwasmHandler :: Handler ByteString\nwasmHandler = liftIO (B.readFile \"hello.wasm\")\n```\n\nand corresponding JS to fetch WASM client-side.\n\n```js\nconst importObject = {};\nWebAssembly.instantiateStreaming(fetch('/wasm'), importObject).then(results =\u003e {\n  // Do something with the results!\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmjio%2Fservant-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmjio%2Fservant-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmjio%2Fservant-wasm/lists"}