{"id":20778146,"url":"https://github.com/stackgl/glslify-api","last_synced_at":"2025-04-30T18:41:47.472Z","repository":{"id":19085087,"uuid":"22312743","full_name":"stackgl/glslify-api","owner":"stackgl","description":"An API and accompanying client for generating glslify shaders in the browser","archived":false,"fork":false,"pushed_at":"2014-07-27T15:15:44.000Z","size":144,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-04-25T20:46:15.549Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-27T14:30:43.000Z","updated_at":"2022-02-26T17:30:58.000Z","dependencies_parsed_at":"2022-09-01T10:00:45.240Z","dependency_job_id":null,"html_url":"https://github.com/stackgl/glslify-api","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fglslify-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fglslify-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fglslify-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fglslify-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackgl","download_url":"https://codeload.github.com/stackgl/glslify-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225041133,"owners_count":17411594,"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-17T13:19:31.512Z","updated_at":"2024-11-17T13:19:31.991Z","avatar_url":"https://github.com/stackgl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glslify-api [![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)\n\nAn API and accompanying client for generating\n[glslify](http://github.com/stackgl/glslify) shaders in the browser.\n\nThis is done by running glslify in the browser, but redirecting its functions\nto read and resolve modules to a thin server. Files are cached locally\nusing [level.js](https://github.com/maxogden/level.js) to speed up the\nbundling speed after the first run – it can even work offline after downloading\nthe required package once!\n\nSee the [example](http://github.com/stackgl/glslify-api/tree/master/example)\ndirectory for a simple example.\n\n[![NPM](https://nodei.co/npm/glslify-api.png)](https://nodei.co/npm/glslify-api/)\n\n## Usage: Server\n\n### `handle = api([cachedir])`\n\nReturns an express-style route handler. `cachedir` is the location to store\ntemporary packages (using [npm-file](http://github.com/hughsk/npm-file)),\nand defaults to `.glslify`.\n\n### `handle(req, res, next)`\n\nGiven a request and response pair, handle a route. Will call `next` if there\nis an error or a appropriate route is not found.\n\n## Usage: Browser\n\n### `getShader = api(serverURI, [options])`\n\nReturns a function for compiling shaders within the browser. `serverURI`\nshould be the URI where you're hosting your copy of the `glslify-api` server –\nif you don't pass one in that's OK too, there's one being hosted at\n[glslify.shader.club](http://glslify.shader.club/).\n\nAvailable options:\n\n* `ttl`: the maximum amount of time to cache a file locally, in milliseconds.\n\n### `getShader(source, done(err, result))`\n\nPass in a shader body `source`, and `done` will be called with either an error\nor the glslified shader when ready.\n\n## HTTP API\n\n### `GET /`\n\nShould return:\n\n``` json\n{\n  \"glslify\": true\n}\n```\n\n### `POST /-/shader`\n\nPipe a whole shader to the request body and get a glslified shader in\nreturn. This is a little more blunt than the approach in the client, but\ncan be useful for small, quick experiments.\n\n### `GET /:package/:file...`\n\nReturns the raw contents of `file` from the `package` package on npm.\n\n## License\n\nMIT. See [LICENSE.md](http://github.com/stackgl/glslify-api/blob/master/LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fglslify-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackgl%2Fglslify-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fglslify-api/lists"}