{"id":17132597,"url":"https://github.com/alphapeter/embedstatic-go","last_synced_at":"2026-05-06T08:37:04.109Z","repository":{"id":148546007,"uuid":"136611667","full_name":"alphapeter/embedstatic-go","owner":"alphapeter","description":"Nodejs script to embed static content in go source code","archived":false,"fork":false,"pushed_at":"2018-06-08T13:04:18.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T11:24:57.861Z","etag":null,"topics":["embed","go","golang","nodejs","npm","npm-scripts","static-files"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/alphapeter.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2018-06-08T11:44:11.000Z","updated_at":"2024-01-10T15:43:33.000Z","dependencies_parsed_at":"2023-05-20T11:45:16.277Z","dependency_job_id":null,"html_url":"https://github.com/alphapeter/embedstatic-go","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/alphapeter%2Fembedstatic-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphapeter%2Fembedstatic-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphapeter%2Fembedstatic-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphapeter%2Fembedstatic-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alphapeter","download_url":"https://codeload.github.com/alphapeter/embedstatic-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217434,"owners_count":20579291,"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":["embed","go","golang","nodejs","npm","npm-scripts","static-files"],"created_at":"2024-10-14T19:27:33.057Z","updated_at":"2026-05-06T08:36:59.077Z","avatar_url":"https://github.com/alphapeter.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Embedstatic-go\n## About\nEmbedstatic-go is a nodejs script that lets you embed static files into go source code by creating a source code file \ncontaining a map (string -\u003e []byte). This lets you create a web server that compiles into a single binary.    \nOne or several directories can be added and it can be easily added as a build step using npm and node js. Since it is common\nto use npm and webpack for building the frontend, this package will be a better fit into the existing front end \nbuild pipeline than corresponding implementations written in go.     \nCheckout the example in the [example directory](example)\n\n## Installation\n### using npm\n```\nnpm install git+https://github.com/alphapeter/embedstatic-go.git\n```\nThis will install the command `embedstatic` into the node bin directory. If you don't use the -g (global flag) when\ninstalling, the command will only be available from npm or npx.   \n\n## Running the command\nThe command takes three arguments,  \n`embedstatic` `source files/directories` `go-package-name` `output-file-name`\n\n## Configuration\nA better way of automating the build process is using npm and create a script that runs 'embedstatic'. This allows for\ndefining the configuration using a npm configuration object `embedstatic-go`. \n### package.json example\n\n```\n{\n  \"name\": \"example-buildscript\",\n  \"version\": \"0.0.1\",\n  \"dependencies\": {\n    \"embedstatic-go\": \"git+https://github.com/alphapeter/embedstatic-go.git\"\n  },\n  \"embedstatic-go\": {\n    \"files\": \"index.html,static\",\n    \"package\": \"main\",\n    \"output\": \"data.go\"\n  },\n  \"scripts\": {\n    \"embed\": \"embedstatic\"\n  }\n}\n```\nThen the embedding can be triggered by running `npm run embed`    \nThe parameters are configured by creating the `embedstatic-go` object in package.json.  \n* `files`: a comma separated list of files and folders to be embedded (no white spaces)\n* `package`: the package name for the output go source file\n* `output`: the file name for the go source file \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphapeter%2Fembedstatic-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphapeter%2Fembedstatic-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphapeter%2Fembedstatic-go/lists"}