{"id":13519659,"url":"https://github.com/ladjs/express-cachebuster","last_synced_at":"2025-03-31T14:30:52.089Z","repository":{"id":66193094,"uuid":"3013847","full_name":"ladjs/express-cachebuster","owner":"ladjs","description":"Provides cross-browser version-control/cache-busting as a dynamic view helper in express.","archived":true,"fork":false,"pushed_at":"2016-08-02T03:53:41.000Z","size":18,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T04:48:03.637Z","etag":null,"topics":[],"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/ladjs.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}},"created_at":"2011-12-19T17:59:59.000Z","updated_at":"2023-01-28T02:18:06.000Z","dependencies_parsed_at":"2023-09-24T06:56:27.473Z","dependency_job_id":null,"html_url":"https://github.com/ladjs/express-cachebuster","commit_stats":{"total_commits":28,"total_committers":4,"mean_commits":7.0,"dds":0.1785714285714286,"last_synced_commit":"e521d7bd2f31aed66aeeb85e534293d2822c25ca"},"previous_names":["niftylettuce/express-cachebuster"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladjs%2Fexpress-cachebuster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladjs%2Fexpress-cachebuster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladjs%2Fexpress-cachebuster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladjs%2Fexpress-cachebuster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ladjs","download_url":"https://codeload.github.com/ladjs/express-cachebuster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246482883,"owners_count":20784793,"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-08-01T05:02:01.664Z","updated_at":"2025-03-31T14:30:51.765Z","avatar_url":"https://github.com/ladjs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\n# Express Cachebuster\n\n`express-cachebuster` provides cross-browser version-control/cache-busting as a dynamic view helper in `express`.\n\nThis was made as an integrated feature of [Expressling][1].\n[1]: http://expressling.com\n\n\n# Quick install\n\n      $ npm install express-cachebuster\n\n# Usage\n\nAdd the following to your `express` app, e.g., `server.js`:\n\n      app.configure(function() {\n        app.set('public', __dirname + '/public')\n      });\n\n      app.dynamicHelpers({\n        cacheBuster: require('express-cachebuster')\n      });\n\n\nIn your views execute the `cacheBuster` function and pass your asset's path.\n\nFor more options see \u003ca href=\"#goodies\"\u003eGoodies\u003c/a\u003e.\n\n**Note:** `$` = variable which is automagically returned by `express-cachebuster`.\n\n## EJS\n\n      \u003c%- cacheBuster('/js/mylibs/script.js') %\u003e\n\nOutputs HTML as shown below for development environment:\n\n      \u003cscript src='/js/mylibs/script.js?v=$currentTimestamp' type='text/javascript'\u003e\u003c/script\u003e\n\n\u0026hellip; and for production environment:\n\n      \u003cscript src='/js/mylibs/script.js' type='text/javascript'\u003e\u003c/script\u003e\n\n## Jade\n\n      != cacheBuster('/stylesheets/style.css')\n\nOutputs HTML as shown below for development environment:\n\n      \u003clink href='/stylesheets/style.css?v=$currentTimestamp' rel='stylesheet'\u003e\n\n\u0026hellip; and for production environment:\n\n      \u003clink href='/stylesheets/style.css' rel='stylesheet'\u003e\n\n# \u003ca href=\"#goodies\" name=\"goodies\"\u003eGoodies\u003c/a\u003e\n\n### You can pass an array of assets to the middleware:\n\n**EJS:** `\u003c%- cacheBuster(['/stylesheets/style.css', '/stylesheets/ie.css']) %\u003e`\n\n**Jade:** `!= cacheBuster(['/stylesheets/style.css', '/stylesheets/ie.css'])`\n\nOutputs HTML as shown below for development environment:\n\n      \u003clink href='/stylesheets/style.css?v=$currentTimestamp' rel='stylesheet'\u003e\n      \u003clink href='/stylesheets/ie.css?v=$currentTimestamp' rel='stylesheet'\u003e\n\n\u0026hellip; and for production environment:\n\n      \u003clink href='/stylesheets/style.css' rel='stylesheet'\u003e\n      \u003clink href='/stylesheets/ie.css' rel='stylesheet'\u003e\n\n### You can pass an object as the second parameter representing attributes and their values to add to the generated tag:\n\n      cacheBuster('/scripts/require.js', {'data-message': 'Hello world', 'data-main': '/app/main.js'})\n\nwhich outputs the following HTML:\n\n      \u003cscript data-main='/app/main.js' data-message='Hello world' src='/scripts/require.js' type='text/javascript'\u003e\u003c/script\u003e\n\n# Contributors\n\nDavid Murdoch - \u003chello@vervestudios.co\u003e - [@davidmurdoch](https://github.com/davidmurdoch)\nButu - \u003cbutu25@gmail.com\u003e - [@butu5](https://github.com/butu5)\n\n# License\n\nMIT Licensed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fladjs%2Fexpress-cachebuster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fladjs%2Fexpress-cachebuster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fladjs%2Fexpress-cachebuster/lists"}