{"id":24738664,"url":"https://github.com/zweifisch/ccjs","last_synced_at":"2026-05-05T04:39:06.777Z","repository":{"id":15593271,"uuid":"18329242","full_name":"zweifisch/ccjs","owner":"zweifisch","description":"client-side common js","archived":false,"fork":false,"pushed_at":"2015-11-28T10:49:24.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T02:56:59.482Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zweifisch.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}},"created_at":"2014-04-01T12:51:37.000Z","updated_at":"2017-05-23T19:54:47.000Z","dependencies_parsed_at":"2022-08-04T05:45:10.660Z","dependency_job_id":null,"html_url":"https://github.com/zweifisch/ccjs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zweifisch/ccjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fccjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fccjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fccjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fccjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zweifisch","download_url":"https://codeload.github.com/zweifisch/ccjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fccjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32636092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-01-27T22:55:17.302Z","updated_at":"2026-05-05T04:39:06.761Z","avatar_url":"https://github.com/zweifisch.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ccjs\n\nclient-side common js\n\n## how does it work\n\n* it will be used as a middlare(described below) inside your connect based\n    application(e.g. express)\n* when the browser make a request to the server asking for a js file, the\n    original js file will be read from disk, and all dependencies of that file\n    get bundled and sent to browser\n* for performance consideration, the js file need to be pre-bundled for\n    deployment, this can be done using\n    [grunt-ccjs](https://github.com/zweifisch/grunt-ccjs)\n\n## limitations\n\n* only works with packages that has little to do with node, like jquery and lodash\n* `require` takes place on the server side, so dynamic require won't work\n\n## usage\n\n### using the middleware\n\nsee `tests/server.js`\n\n```javascript\nvar path = require('path');\nvar ccjs = require('ccjs').middleware;\n\napp.use(ccjs({root:path.join(__dirname, '/public/js')}));\n```\n\n```html\n\u003cscript src=\"main.js?commonjs=1\"\u003e\u003c/script\u003e\n```\n\n### coffeescript\n\n```sh\nnpm install --save coffee-script\n```\n\n```coffee\napp.use ccjs\n\troot: path.join __dirname, '/public/js'\n\tcoffee: on\n```\n\n### grunt plugin\n\n* [grunt-ccjs](https://github.com/zweifisch/grunt-ccjs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzweifisch%2Fccjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzweifisch%2Fccjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzweifisch%2Fccjs/lists"}