{"id":15364653,"url":"https://github.com/venables/smaller-asset-rack","last_synced_at":"2026-02-24T07:35:39.410Z","repository":{"id":14017229,"uuid":"16718993","full_name":"venables/smaller-asset-rack","owner":"venables","description":"A (Smaller) Static Web Framework for Nodejs","archived":false,"fork":false,"pushed_at":"2015-07-15T15:50:33.000Z","size":696,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-30T08:49:50.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","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/venables.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}},"created_at":"2014-02-11T04:07:44.000Z","updated_at":"2015-04-02T19:17:28.000Z","dependencies_parsed_at":"2022-09-26T20:00:30.925Z","dependency_job_id":null,"html_url":"https://github.com/venables/smaller-asset-rack","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/venables/smaller-asset-rack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venables%2Fsmaller-asset-rack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venables%2Fsmaller-asset-rack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venables%2Fsmaller-asset-rack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venables%2Fsmaller-asset-rack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/venables","download_url":"https://codeload.github.com/venables/smaller-asset-rack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venables%2Fsmaller-asset-rack/sbom","scorecard":{"id":918394,"data":{"date":"2025-08-11","repo":{"name":"github.com/venables/smaller-asset-rack","commit":"0b9b04ea4367cd902578f8e173738fee3ea2931c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 3/27 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T22:46:04.975Z","repository_id":14017229,"created_at":"2025-08-24T22:46:04.979Z","updated_at":"2025-08-24T22:46:04.979Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29775010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T04:54:30.205Z","status":"ssl_error","status_checked_at":"2026-02-24T04:53:58.628Z","response_time":75,"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":[],"created_at":"2024-10-01T13:12:58.016Z","updated_at":"2026-02-24T07:35:39.394Z","avatar_url":"https://github.com/venables.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smaller-asset-rack\n\nThis is a fork of [asset-rack](https://github.com/techpines/asset-rack) which includes only the following Asset types:\n\n* StaticAsset\n* DynamicAsset\n* BrowserifyAsset\n* LessAsset\n* AngularTemplates\n\n----------------------\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'smaller-asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n\u003e __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static',\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/style.less'\n    })\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n\u003clink href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\"\u003e\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/venables/smaller-asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n\n#### For Stylesheets\n* [Less](http://github.com/venables/smaller-asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n\n#### Templates\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Other\n* [StaticAssets](https://github.com/venables/smaller-asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n* [DynamicAssets](https://github.com/venables/smaller-asset-rack/tree/master/lib#dynamicassets) - For compiling file-based assets like Less or Stylus in an entire directory.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy',\n        this.emit 'created',\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) -\u003e\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n### Running in Production Mode\n\nIf you provide the options `configFile` in your deploy options then a config file will be written:\n\n```js\nassets.deploy(\n    configFile: __dirname + '/rack.json',\n    provider: 'amazon',\n    container: ...\n)\n```\n\nThen you can create your assets from the file like this:\n\n```js\nassets = rack.fromConfigFile({\n    configFile: __dirname + '/rack.json',\n    hostname: 'cdn.example.com'\n});\napp.use(assets);\n```\n\nAnd now all of your server side templates will reference your CDN.  Also, if you do happen to hit one of your static urls on the server, then you will be redirected to the CDN.\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# Changelog\n\n### 2.2.1\n\n* A few small tweaks.\n\n### 2.2.0\n\n* Watch and asset recreation is now working.  This should be considered experimental for this version.\n\n```js\nnew StylusAsset({\n    watch: true,\n    ...\n});\n```\n\n* Gzip is here finally.\n\n```js\nnew BrowserifyAsset({\n    gzip: true,\n    ...\n});\n```\n\n* Now adding sub assets to an asset is much simpler, just use `addAsset`.\n\n```js\nthis.addAsset(asset);\nthis.emit('created');\n```\n\nThanks @moellenbeck, @d1plo1d, @undashes, and @noc7c9 for contributing!\n\n### 2.1.4\n\n* @vicapow Better error handling for `LessAsset`.\n\n### 2.1.3\n\n* @noc7c9 Added generalized `rack.util.walk` function, need to document the function.\n* @noc7c9 Added `DynamicAssets` class.\n* @noc7c9 is awesome.\n\n### 2.1.2\n\n* Added ability to configure Stylus, thanks to @noc7c9.\n\n```coffee\nnew StylusAsset\n  url: '/style.css'\n  filename: __dirname + '/style/fun.styl'\n  config: -\u003e\n    @use bootstrap()\n    @define 'setting', 90\n```\n\nAnd for javascript:\n\n```js\nnew StylusAsset({\n  url: '/style.css',\n  filename: __dirname + '/style/fun.styl',\n  config: function (stylus) {\n    stylus // using \"this\" here seems a little unnatural\n      .use(bootstrap())\n      .define('setting', 90);\n  }\n});\n```\n\n# Test\n\nTesting is easy and fun!\n\n```js\ncd smaller-asset-rack\nnpm install\nnpm test\n```\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvenables%2Fsmaller-asset-rack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvenables%2Fsmaller-asset-rack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvenables%2Fsmaller-asset-rack/lists"}