{"id":20230864,"url":"https://github.com/ethul/connect-uglify-js","last_synced_at":"2025-04-10T18:05:27.024Z","repository":{"id":2375693,"uuid":"3340590","full_name":"ethul/connect-uglify-js","owner":"ethul","description":null,"archived":false,"fork":false,"pushed_at":"2013-12-13T03:15:35.000Z","size":110,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T15:47:28.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"stonewell/lib7zip","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ethul.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":"2012-02-03T01:05:43.000Z","updated_at":"2013-12-13T03:15:35.000Z","dependencies_parsed_at":"2022-09-17T23:11:29.316Z","dependency_job_id":null,"html_url":"https://github.com/ethul/connect-uglify-js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethul%2Fconnect-uglify-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethul%2Fconnect-uglify-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethul%2Fconnect-uglify-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethul%2Fconnect-uglify-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethul","download_url":"https://codeload.github.com/ethul/connect-uglify-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785945,"owners_count":20995645,"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-14T07:44:04.850Z","updated_at":"2025-04-10T18:05:26.996Z","avatar_url":"https://github.com/ethul.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connect-uglify-js\n\nConnect-uglify-js is middleware for\n[connect](http://www.senchalabs.org/connect/) that uses\n[uglify-js](https://github.com/mishoo/UglifyJS) to compress and mangle\nyour JavaScript.\n\nThis middleware uses a memory caching strategy by default, which means\nthat once a JavaScript file has been uglified, the result is stored into\nthe cache, and the life of the cache is the life of the node instance.\n\n## Installation\n\n* Install connect-uglify-js with NPM\n\n        npm install connect-uglify-js\n\n## Getting Started: Express server demo\n\n```javascript\nvar express = require(\"express\")\n  , uglify = require(\"connect-uglify-js\")\n  , app = module.exports = express.createServer();\n\napp.configure(function(){\n  app.set(\"views\", __dirname + \"/views\");\n  app.set(\"view engine\", \"jade\");\n  app.use(express.bodyParser());\n  app.use(express.methodOverride());\n  app.use(express.static(__dirname + \"/public\"));\n  app.use(\"/assets\",uglify.middleware(__dirname + \"/public/javascripts\"));\n  app.use(app.router);\n});\n\napp.configure(\"development\", function(){\n  app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); \n});\napp.configure(\"production\", function(){\n  app.use(express.errorHandler()); \n});\n\napp.get(\"/\", function(request,response){response.render(\"index\",{});});\n\napp.listen(process.env.PORT || 3000);\nconsole.log(\"Express server listening on port %d in %s mode\", app.address().port, app.settings.env);\n```\n\nAbove we have added the middleware to our application mounted under\n`/assets`. It is recommended to pick a mount point, otherwise the\nmiddleware will conflict with the serving of static files.\n\nTo complete the example, we can write our HTML to request the uglified\nJavaScript as follows, assuming `index.js` exists in\n`__dirname/public/javascripts`.\n\n```jade\n!!! 5\nhead\n  meta(charset=\"utf-8\")\n  title Demo\nbody\n  h1 Demo\n  script(src=\"/assets/index.js\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethul%2Fconnect-uglify-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethul%2Fconnect-uglify-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethul%2Fconnect-uglify-js/lists"}