{"id":17446435,"url":"https://github.com/damonoehlman/devcaps-node","last_synced_at":"2026-02-03T09:03:27.493Z","repository":{"id":47324805,"uuid":"2479149","full_name":"DamonOehlman/devcaps-node","owner":"DamonOehlman","description":"Devcaps implementations for Connect and Express","archived":false,"fork":false,"pushed_at":"2025-07-21T06:20:38.000Z","size":24,"stargazers_count":3,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-21T08:24:08.752Z","etag":null,"topics":["deprecated","middleware"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/DamonOehlman.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2011-09-29T01:15:35.000Z","updated_at":"2023-03-04T03:25:58.000Z","dependencies_parsed_at":"2024-10-19T22:36:31.192Z","dependency_job_id":null,"html_url":"https://github.com/DamonOehlman/devcaps-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DamonOehlman/devcaps-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Fdevcaps-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Fdevcaps-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Fdevcaps-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Fdevcaps-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DamonOehlman","download_url":"https://codeload.github.com/DamonOehlman/devcaps-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Fdevcaps-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29039341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T08:41:49.363Z","status":"ssl_error","status_checked_at":"2026-02-03T08:40:19.255Z","response_time":96,"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":["deprecated","middleware"],"created_at":"2024-10-17T18:59:20.340Z","updated_at":"2026-02-03T09:03:27.476Z","avatar_url":"https://github.com/DamonOehlman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# connect-devcaps\n\n__NOTE:__ This repository has been deprecated, and has been replaced by the main [devcaps](/DamonOehlman/devcaps) repository which now contains an implementation for Node.\n\nThis is a [devcaps](/DamonOehlman/devcaps) reference implementation designed to be compatible with [Connect](http://senchalabs.github.com/connect) and [Express](http://expressjs.org/).\n\nFor information on the general devcaps process, see the [devcaps repo](/devcaps/devcaps).\n\n## Getting Started\n\nFirstly, install from npm:\n\n```\nnpm install connect-devcaps\n```\n\nOnce you have `connect-devcaps` available in your express / connect project, you can add it as middleware:\n\n```js\nvar connect = require('connect'),\n    app = connect.createServer(),\n    devcaps = require('connect-devcaps');\n   \n// initialise the cookie parser and body parser as they are required for devcaps to work\napp.use(connect.cookieParser());\napp.use(connect.bodyParser());\n\n// initialise devcaps detection for all checks\napp.use(devcaps.checkFor());\n\n// other initialization here\n\n// listen on port 3000\napp.listen(3000);\n```\n\nBy default, the devcaps module will listen for all checks that have been [defined](/devcaps/connect-devcaps/blob/master/lib/definitions.js) but can be configured just to detect and communicate the availability of certain features.  This is generally a good habit to get into as it will keep both the detection page and the `DEVCAPS` cookie data light.\n\nFor instance, to install devcaps just checking for screen data and the flexbox information, invoke as per below:\n\n```js\napp.use(devcaps.checkFor('screen flexbox'));\n```\n## Accessing devcaps data\n\nOnce the devcaps middleware has been installed, a `devcaps` object will be patched into the request object:\n\n```js\napp.use(function(req, res, next) {\n    if (req.devcaps.screen.width \u003e 480) {\n        // render desktop template\n    }\n    else {\n        // render mobile page\n    }\n});\n```\n\n## Roadmap\n\n- Rather than pass the full devcaps information around in the cookie, store devcaps profiles on the server side and just pass around PROF:n in the cookie. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamonoehlman%2Fdevcaps-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdamonoehlman%2Fdevcaps-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamonoehlman%2Fdevcaps-node/lists"}