{"_id":"grunt-hashmap","_rev":"30-de43ffac6660a8c776a7ea4c615db27c","name":"grunt-hashmap","description":"Generate a hash mapping for your assets, to burst cache","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"grunt-hashmap","description":"Generate a hash mapping for your assets, to burst cache","version":"0.1.0","homepage":"https://github.com/ktmud/grunt-hashmap","author":{"name":"ktmud","email":"jyyjcc@gmail.com"},"repository":{"type":"git","url":"git://github.com/ktmud/grunt-hashmap.git"},"bugs":{"url":"https://github.com/ktmud/grunt-hashmap/issues"},"licenses":[{"type":"MIT","url":"https://github.com/ktmud/grunt-hashmap/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.1.1","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.1.2","grunt":"~0.4.0"},"peerDependencies":{"grunt":"~0.4.0"},"keywords":["gruntplugin"],"_id":"grunt-hashmap@0.1.0","dist":{"shasum":"e86a3bf65dd7dd917aa2632105ddded50d19e0b7","tarball":"https://registry.npmjs.org/grunt-hashmap/-/grunt-hashmap-0.1.0.tgz","integrity":"sha512-FU/GBE89yDHASpYRMpgoZDob7Cx+60AaOqT7VYo399jlYHEnvhg/8PrOZPX70lTMGySmZNNG0IRKedSjwlXw0w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH7UB3SoCxPKcn3qhcu38Bk1jgb9h8ICpTzkPRGKP2AFAiA0VK4B0Uj6IMfUjfEK2xArWTnP6C8RngCNPcupUYRlmw=="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"ktmud","email":"jyyjcc@gmail.com"},"maintainers":[{"name":"ktmud","email":"jyyjcc@gmail.com"}],"directories":{}},"0.1.1":{"name":"grunt-hashmap","description":"Generate a hash mapping for your assets, to burst cache","version":"0.1.1","homepage":"https://github.com/ktmud/grunt-hashmap","author":{"name":"ktmud","email":"jyyjcc@gmail.com"},"repository":{"type":"git","url":"git://github.com/ktmud/grunt-hashmap.git"},"bugs":{"url":"https://github.com/ktmud/grunt-hashmap/issues"},"licenses":[{"type":"MIT","url":"https://github.com/ktmud/grunt-hashmap/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.1.1","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.1.2","grunt":"~0.4.0"},"peerDependencies":{"grunt":"~0.4.0"},"keywords":["gruntplugin"],"_id":"grunt-hashmap@0.1.1","dist":{"shasum":"7f949b15a49d741e07981e010d2aeecbf0489292","tarball":"https://registry.npmjs.org/grunt-hashmap/-/grunt-hashmap-0.1.1.tgz","integrity":"sha512-XuoIVXBjwF+56HrHbOzebPdKk0D6ctIf10ZqHPfZYS2z1nKqJoqG1m3ivWS+J00oEvPVp14eN9KBChmkdzU9eg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9wkCMEN3iV/p+NYLYRwX1Er0kWOyi6P2+/XhDIew+XgIgeaJ7zCMYh1nWZDJmMsvD9PWQM/aBC7zWprGkizJx9Qw="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"ktmud","email":"jyyjcc@gmail.com"},"maintainers":[{"name":"ktmud","email":"jyyjcc@gmail.com"}]},"0.1.2":{"name":"grunt-hashmap","description":"Generate a hash mapping for your assets, to burst cache","version":"0.1.2","homepage":"https://github.com/ktmud/grunt-hashmap","author":{"name":"ktmud","email":"jyyjcc@gmail.com"},"repository":{"type":"git","url":"git://github.com/ktmud/grunt-hashmap.git"},"bugs":{"url":"https://github.com/ktmud/grunt-hashmap/issues"},"licenses":[{"type":"MIT","url":"https://github.com/ktmud/grunt-hashmap/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.1.1","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.1.2","grunt":"~0.4.0"},"peerDependencies":{"grunt":"~0.4.0"},"keywords":["gruntplugin"],"_id":"grunt-hashmap@0.1.2","dist":{"shasum":"aef08b78bb380361609dbe98ea25a17735b018cd","tarball":"https://registry.npmjs.org/grunt-hashmap/-/grunt-hashmap-0.1.2.tgz","integrity":"sha512-4jj/qw8ytBTUtHxrouaI6BWV3EvmXRYwos0hOpj4bNqf1toKp1uxGRDMCMA+zdrUKymoQPB6tCSTFvWBC6JeCA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEEvItKPt4reRJp805QN1euEV30S0/VCxd3KbzwEKLY9AiAzIVWuJKMPaGMJOLGNawWobGa6N9Gcs0P+wVu4S8hzJQ=="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"ktmud","email":"jyyjcc@gmail.com"},"maintainers":[{"name":"ktmud","email":"jyyjcc@gmail.com"}]},"0.1.3":{"name":"grunt-hashmap","description":"Generate a hash mapping for your assets, to burst cache","version":"0.1.3","homepage":"https://github.com/ktmud/grunt-hashmap","author":{"name":"ktmud","email":"jyyjcc@gmail.com"},"repository":{"type":"git","url":"git://github.com/ktmud/grunt-hashmap.git"},"bugs":{"url":"https://github.com/ktmud/grunt-hashmap/issues"},"licenses":[{"type":"MIT","url":"https://github.com/ktmud/grunt-hashmap/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.1.1","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.1.2","grunt":"~0.4.0"},"peerDependencies":{"grunt":"~0.4.0"},"keywords":["gruntplugin"],"_id":"grunt-hashmap@0.1.3","dist":{"shasum":"4b5726fa3d2a9ad3628226186e1cb20205a9791c","tarball":"https://registry.npmjs.org/grunt-hashmap/-/grunt-hashmap-0.1.3.tgz","integrity":"sha512-nlmDvGGN7RNpLrRuQdW+kFQQVMyX7ZJsKVLeZ9yfxkiBYNJLxRUWlXio8LiFzDZymbZrxpMkbLmyg0r4R/Rhcg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEYh7C5J1uiZpDkYf58lrEiTqmDAafpkSryB8jq5g0MsAiEA0R6+i28gL5ccZKImWx+pHLA76DNXof5m7NBBH1N1gOc="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"ktmud","email":"jyyjcc@gmail.com"},"maintainers":[{"name":"ktmud","email":"jyyjcc@gmail.com"}]},"0.1.3-1":{"name":"grunt-hashmap","description":"Generate a hash mapping for your assets, to burst cache","version":"0.1.3-1","homepage":"https://github.com/ktmud/grunt-hashmap","author":{"name":"ktmud","email":"jyyjcc@gmail.com"},"repository":{"type":"git","url":"git://github.com/ktmud/grunt-hashmap.git"},"bugs":{"url":"https://github.com/ktmud/grunt-hashmap/issues"},"licenses":[{"type":"MIT","url":"https://github.com/ktmud/grunt-hashmap/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.1.1","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.1.2","grunt":"~0.4.0"},"peerDependencies":{"grunt":"~0.4.0"},"keywords":["gruntplugin","hash","static","deploy","assets"],"_id":"grunt-hashmap@0.1.3-1","dist":{"shasum":"0eaf18f949751beb1e799ff5a5b380fa94709a71","tarball":"https://registry.npmjs.org/grunt-hashmap/-/grunt-hashmap-0.1.3-1.tgz","integrity":"sha512-2gZp5CyLeY8+Tzkht7TybFwfjJBqmOyv7hiFCpLP9vaWmcGckrIm5tsVw/c3ykxwelNpqmTwQQCZNeSLByRNeA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOfR1JlBaneIcK90NFkrQGvqt2AsAjn/5SnftFf+mwiAIhAJhiJOxFHaAUETg5r41wXKwGTvqTuQzYhvAswfkRayzm"}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"ktmud","email":"jyyjcc@gmail.com"},"maintainers":[{"name":"ktmud","email":"jyyjcc@gmail.com"}]},"0.1.4":{"name":"grunt-hashmap","description":"Generate a hash mapping for your assets, to burst cache","version":"0.1.4","homepage":"https://github.com/ktmud/grunt-hashmap","author":{"name":"ktmud","email":"jyyjcc@gmail.com"},"repository":{"type":"git","url":"git://github.com/ktmud/grunt-hashmap.git"},"bugs":{"url":"https://github.com/ktmud/grunt-hashmap/issues"},"licenses":[{"type":"MIT","url":"https://github.com/ktmud/grunt-hashmap/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.1.1","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.1.2","grunt":"~0.4.1"},"peerDependencies":{"grunt":"~0.4.1"},"keywords":["gruntplugin","hash","static","deploy","assets"],"_id":"grunt-hashmap@0.1.4","dist":{"shasum":"412711c17e27f4a4a4e6782487ffdf2410aaa2c7","tarball":"https://registry.npmjs.org/grunt-hashmap/-/grunt-hashmap-0.1.4.tgz","integrity":"sha512-qpKMQrUWY4eOMV/4zK0jzkLH2k383RjOYTkPrZ7QzI4uQ0mjiUYrU8GBC+FbGSUlUO00daz7V/kXPpgqywTxNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEan4NYc6HDQPwwkfKbI012h7VrXTsILS4yQ4bncvq1/AiBzOb+fiReyi0RHIFsdNbBa8Simq1IywdzYVaG/MHIDVQ=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"ktmud","email":"jyyjcc@gmail.com"},"maintainers":[{"name":"ktmud","email":"jyyjcc@gmail.com"}]},"0.1.5":{"name":"grunt-hashmap","description":"Generate a hash mapping for your assets, to burst cache","version":"0.1.5","homepage":"https://github.com/ktmud/grunt-hashmap","author":{"name":"ktmud","email":"kissmud@gmail.com"},"repository":{"type":"git","url":"git://github.com/ktmud/grunt-hashmap.git"},"bugs":{"url":"https://github.com/ktmud/grunt-hashmap/issues"},"licenses":[{"type":"MIT","url":"https://github.com/ktmud/grunt-hashmap/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.1.1","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.1.2","grunt":"~0.4.1"},"peerDependencies":{"grunt":"~0.4.1"},"keywords":["gruntplugin","hash","static","deploy","assets"],"_id":"grunt-hashmap@0.1.5","dist":{"shasum":"b67e3f42a5ef4943aaf700d6e90173737338aea8","tarball":"https://registry.npmjs.org/grunt-hashmap/-/grunt-hashmap-0.1.5.tgz","integrity":"sha512-aMs16wxR74LAMYbXjY96ftWskfj2LV9rd6URFslXxbcNM9WewQvyovyBkTZZCr3MdX/RdRCIjuuc0mQ/ndIf0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZ7QhNJw04uM11D8f9Z3s70MsCWyYZbynvMdHoDccCDAIhANNejo1FHABuAtjP3pxq0PTIbtBTjQ/UJasHUp9ufkgU"}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ktmud","email":"jyyjcc@gmail.com"},"maintainers":[{"name":"ktmud","email":"jyyjcc@gmail.com"}]},"0.2.0":{"name":"grunt-hashmap","description":"Generate a hash mapping for your assets, to burst cache","version":"0.2.0","homepage":"https://github.com/ktmud/grunt-hashmap","author":{"name":"ktmud","email":"kissmud@gmail.com"},"repository":{"type":"git","url":"git://github.com/ktmud/grunt-hashmap.git"},"bugs":{"url":"https://github.com/ktmud/grunt-hashmap/issues"},"licenses":[{"type":"MIT","url":"https://github.com/ktmud/grunt-hashmap/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.10.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.1.1","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.1.2","grunt":"~0.4.1"},"peerDependencies":{"grunt":">=0.4.0"},"keywords":["gruntplugin","hash","static","deploy","assets"],"gitHead":"e919e7c502e1885ceeb36954974f274301785531","_id":"grunt-hashmap@0.2.0","_shasum":"824a7ed060b90cda6a931385da534879868f55be","_from":".","_npmVersion":"3.3.9","_nodeVersion":"5.0.0","_npmUser":{"name":"ktmud","email":"jyyjcc@gmail.com"},"maintainers":[{"name":"ktmud","email":"jyyjcc@gmail.com"}],"dist":{"shasum":"824a7ed060b90cda6a931385da534879868f55be","tarball":"https://registry.npmjs.org/grunt-hashmap/-/grunt-hashmap-0.2.0.tgz","integrity":"sha512-eeu1d+eoYxHhMzgiA6rgab9r5ddffvQ3cwSOeuXIaFiGrt2TfcGzSAdLBjxCtL8xePDoV1h9aKxCnnibcbiGNw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCD22Z82MhjIZ2+0rJEcIvmRUnDMYdxX+I1zUccuJXvqAIgFPy42fbcmK9rFGw40ZNxXPRFHjpmoVoi0pjnCshHVcI="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/grunt-hashmap-0.2.0.tgz_1470128470859_0.04735915013588965"}},"1.0.0":{"name":"grunt-hashmap","description":"Generate a hash mapping for your assets, to burst cache","version":"1.0.0","homepage":"https://github.com/ktmud/grunt-hashmap","author":{"name":"ktmud","email":"kissmud@gmail.com"},"repository":{"type":"git","url":"git://github.com/ktmud/grunt-hashmap.git"},"bugs":{"url":"https://github.com/ktmud/grunt-hashmap/issues"},"license":"MIT","main":"Gruntfile.js","engines":{"node":">= 0.10.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~1.0.0","grunt-contrib-clean":"~1.0.0","grunt-contrib-nodeunit":"~1.0.0","grunt":"~1.0.1"},"peerDependencies":{"grunt":">=0.4.0"},"keywords":["gruntplugin","hash","static","deploy","assets"],"gitHead":"b12c44858a183dfd4fca77731b089afe343fb357","_id":"grunt-hashmap@1.0.0","_shasum":"c0f3cc474936c097c73ac6c6d707e455d1949062","_from":".","_npmVersion":"3.3.9","_nodeVersion":"5.0.0","_npmUser":{"name":"ktmud","email":"jyyjcc@gmail.com"},"maintainers":[{"name":"ktmud","email":"jyyjcc@gmail.com"}],"dist":{"shasum":"c0f3cc474936c097c73ac6c6d707e455d1949062","tarball":"https://registry.npmjs.org/grunt-hashmap/-/grunt-hashmap-1.0.0.tgz","integrity":"sha512-PkDXNOmq3Mooj+ObMSm2QWyekj8tS5xH1aIqYOqCrVqOQmaMYxWmgUTF4UKmtcpf5uMioF4ZYoYRkBpfLXHJ9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICiU0IT25gbLCcej8z8ftcHC8CNpzLAmDZZRNVl07jR2AiAvc+mOqYR4sdU9KvZF1+ZveGhrwbEdVOkjH1/i8FW+5Q=="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/grunt-hashmap-1.0.0.tgz_1470129079064_0.5912226664368063"}},"1.1.0":{"name":"grunt-hashmap","description":"Generate a hash mapping for your assets, to burst cache","version":"1.1.0","homepage":"https://github.com/ktmud/grunt-hashmap","author":{"name":"ktmud","email":"kissmud@gmail.com"},"repository":{"type":"git","url":"git://github.com/ktmud/grunt-hashmap.git"},"bugs":{"url":"https://github.com/ktmud/grunt-hashmap/issues"},"license":"MIT","main":"Gruntfile.js","engines":{"node":">= 0.10.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~1.1.0","grunt-contrib-clean":"~1.0.0","grunt-contrib-nodeunit":"~1.0.0","grunt":"~1.0.1"},"peerDependencies":{"grunt":">=0.4.5"},"keywords":["gruntplugin","hash","static","deploy","assets"],"gitHead":"c3b50c2688dcec7f2a064098658b5c6c9ecee215","_id":"grunt-hashmap@1.1.0","_shasum":"99d533ea69da945fb843b934c5bf834ec6865de0","_from":".","_npmVersion":"2.9.0","_nodeVersion":"6.9.1","_npmUser":{"name":"ktmud","email":"jyyjcc@gmail.com"},"maintainers":[{"name":"ktmud","email":"jyyjcc@gmail.com"}],"dist":{"shasum":"99d533ea69da945fb843b934c5bf834ec6865de0","tarball":"https://registry.npmjs.org/grunt-hashmap/-/grunt-hashmap-1.1.0.tgz","integrity":"sha512-BVuMJkMiZBSNmeH+iLHgZbHkeV5wUpGN7jGgxGo4lLwPfiygLkZSwRdw6zYzRq1QbBCDWO0rZXGv1Sg4Gcavfg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzJmbny78xFa2hyBTgR5i2SV7bGeBqUSfzznZctRp4PAIgIZqGhGMI+NM61xb57K/RIvnrGV3DqwaEx/a/9s14bLM="}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/grunt-hashmap-1.1.0.tgz_1484158345425_0.4940995436627418"}}},"readme":"# grunt-hashmap [![Build Status](https://api.travis-ci.org/ktmud/grunt-hashmap.png?branch=master)](https://travis-ci.org/ktmud/grunt-hashmap)\n\n> Generate a hash mapping for your assets files, in order to burst cache\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-hashmap --save-dev\n```\n\nOne the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-hashmap');\n```\n\n## The \"hashmap\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `hashmap` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  hashmap: {\n    options: {\n      // These are default options\n      output: '#{= dest}/hash.json',\n      etag: null, // See below([#](#option-etag))\n      algorithm: 'md5', // the algorithm to create the hash\n      rename: '#{= dirname}/#{= basename}_#{= hash}#{= extname}', // save the original file as what\n      keep: true, // should we keep the original file or not\n      merge: false, // merge hash results into existing `hash.json` file or override it.\n      hashlen: 10, // length for hashsum digest\n    },\n    your_target: {\n      // Target-specific file lists and/or options go here.\n      options: {\n        output: 'static/versions.json',\n      },\n      files: {\n        cwd: 'static/dist',\n        src: ['js/**/*.js', 'css/**/*.css'],\n        dest: 'static/dist'\n      },\n    },\n  },\n})\n```\n\nIn your express application, add a **static_url** generator to template helpers:\n\n``` javascript\nvar path = require('path');\nvar hash_cache = require('./static/hash.json');\n\nvar reg_css_js = /\\.(css|js)$/;\n\n// change these consts according to the app's running environment\nvar STATIC_ROOT = 'http://img.example.com';\nvar DEBUG = false;\n\nfunction static_url(p) {\n  if (p[0] == '/') p = p.slice(1);\n  if (DEBUG || !reg_css_js.test(p)) return STATIC_ROOT + '/' + p;\n\n  var hash = hash_cache[p];\n  if (hash) {\n    var ext = path.extname(p);\n    p = path.join(path.dirname(p), path.basename(p, ext) + '_' + hash + ext); \n  }\n  return STATIC_ROOT + '/' + p;\n}\n\n\napp.locals({\n  static: static_url\n});\n```\n\nIn your template, always refer to static file url like this:\n\n``` jade\nscript(src=\"#{static('/css/abc.css')}\")\n```\n\nThe output would be:\n\n```\n<script type=\"text/javascript\" src=\"http://img.example.com/css/abc_83hfa2gi.css\"></script>\n\n<!-- or when in debug mode: -->\n<script type=\"text/javascript\" src=\"/css/abc.css\"></script>\n```\n\n\n### Options\n\n#### options.output\nType: `String`\nDefault value: `'#{= dest}/hash.json'`\n\nWhere to save the hash mapping json file.\nAvailable variables are `dest`, `cwd`.\nYou can always use `#{= grunt.config.get(...) }'` to access config data in your `Gruntfile`.\n\nSet to `null` will disable the output.\n\nThe output format:\n\n```js\n{\n  \"a/b.js\": \"aaa93n3f2\",\n  \"foo.css\": \"maaof33mao\"\n}\n```\n\n#### options.etag <a id=\"option-etag\"></a>\nType: `String`\nDefault value: `null`\n\nIn spite of standard digest algorithms provided by the\n[crypto]('http://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm') module,\nyou can set a \"etag\" format to use as file version.\n\nSet `etag` to `true` will use the default format: `#{= size}-#{= +mtime}`.\n\nAll values in a [fs.Stats](http://nodejs.org/api/fs.html#fs_class_fs_stats) result are available.\n\n#### options.algorithm\nType: `String`\nDefault value: `'md5'`\n\nThe algorithm to generate hash digests. Depend on the version of OpenSSL on the platform.\nExamples are `'sha1'`, `'md5'`, `'sha256'`, etc.\n\n#### options.hashlen\nType: `Number`\nDefault value: `10`\n\nThe length of a hash digest hex value.\n\n#### options.rename\nType: `String`\nDefault value: `'#{= dirname}/#{= basename}\\_#{= hash}#{= extname}'`\n\nRename files, to include a hash in it. This is often for safely bursting cache.\nAvailable variables are:\n\n  - **hash**      - The hash/etag value.\n  - **dest**      - The destination directory.\n  - **cwd**       - The `cwd` you setted for `files` prop section.\n  - **filepath**  - The path of the file.\n  - **basename**  - The basename of the file, with extension name excluded.\n  - **dirname**   - The directory name of the file.\n  - **extname**   - The extension name of the file.\n\nExamples:\n\n    \"abc/defg/hijk.js\" =>\n    {\n      filepath: \"abc/defg/hijk.js\",\n      basename: \"hijk\",\n      dirname: \"abc/defg\",\n      extname: \"js\"\n    }\n\nWith the default rename format, the result will be something like `\"abc/defg/hijk\\_e8e7f9e4.js\"`.\n\nWill raise a warning if the renamed target is not in dest directory.\n  \n#### options.keep\nType: `String`\nDefault value: `true`\n\nWhether to keep the original files after rename it.\n\n#### options.merge\nType: `String`\nDefault value: `false`\n\nThis option is mainly for cases like this:\n\n```js\ngrunt.initConfig({\n  hashmap: {\n    options: {\n      output: 'static/hash.json',\n      merge: true,\n    },\n    js: {\n      cwd: 'static/dist',\n      src: 'js/**/*.js',\n      dest: 'static/dist'\n    },\n    css: {\n      cwd: 'static/dist',\n      src: 'css/**/*.css',\n      dest: 'static/dist'\n    },\n  },\n  watch: {\n    js: {\n      files: ['static/js/**/*.js'],\n      tasks: ['hashmap:js']\n    }, \n    css: {\n      files: ['static/css/**/*.css'],\n      tasks: ['hashmap:css']\n    }\n  },\n})\n```\n\nHashmap tasks for css and js are created seperately.\nSo with the `grunt-contrib-watch` running, when you modify one single file,\ngrunt won't need to run the whole hash mapping process for all files.\n\nSince all the hash results will be written to the same file, and the hashmaps\nare automatically merged. It is safe to refer to `hash.json` for all static files\nin your application's static url generator.\n\nThe downside of this practice is that hashes for deleted files will never be removed,\nunless `hash.json` is removed. But of course, you can always set up a `grunt clean` task. \n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n\n* 0.1.5 -  add option.salt to burst all the cache, thanks @theoephraim \n* 0.1.4 -  format output json, and sort it by filenames (diff a hashmap made easy). Thanks @dpolivy !\n* 0.1.1 -  add options.encoding for file contents reading\n* 0.1.0 -  first release\n","maintainers":[{"name":"ktmud","email":"jyyjcc@gmail.com"}],"time":{"modified":"2022-06-18T15:08:30.559Z","created":"2013-03-02T03:55:43.310Z","0.1.0":"2013-03-02T03:55:45.153Z","0.1.1":"2013-03-05T16:40:35.396Z","0.1.2":"2013-03-05T16:42:50.116Z","0.1.3":"2013-03-16T17:00:31.272Z","0.1.3-1":"2013-05-07T02:27:55.410Z","0.1.4":"2013-08-15T02:17:18.487Z","0.1.5":"2013-12-24T02:45:02.875Z","0.2.0":"2016-08-02T09:01:12.548Z","1.0.0":"2016-08-02T09:11:20.926Z","1.1.0":"2017-01-11T18:12:26.177Z"},"author":{"name":"ktmud","email":"kissmud@gmail.com"},"repository":{"type":"git","url":"git://github.com/ktmud/grunt-hashmap.git"},"homepage":"https://github.com/ktmud/grunt-hashmap","keywords":["gruntplugin","hash","static","deploy","assets"],"bugs":{"url":"https://github.com/ktmud/grunt-hashmap/issues"},"readmeFilename":"README.md","license":"MIT","users":{"mutian":true,"zkerhcy":true}}