{"id":19560673,"url":"https://github.com/zoubin/index-hashify","last_synced_at":"2025-07-13T12:40:19.225Z","repository":{"id":34531327,"uuid":"38474280","full_name":"zoubin/index-hashify","owner":"zoubin","description":"hashify browserify row index","archived":false,"fork":false,"pushed_at":"2016-04-25T12:59:07.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-10T17:48:22.400Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoubin.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":"2015-07-03T05:41:16.000Z","updated_at":"2016-04-25T12:18:56.000Z","dependencies_parsed_at":"2022-09-17T02:23:07.504Z","dependency_job_id":null,"html_url":"https://github.com/zoubin/index-hashify","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zoubin/index-hashify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Findex-hashify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Findex-hashify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Findex-hashify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Findex-hashify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoubin","download_url":"https://codeload.github.com/zoubin/index-hashify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Findex-hashify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264868999,"owners_count":23676095,"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-11T05:08:26.408Z","updated_at":"2025-07-13T12:40:18.978Z","avatar_url":"https://github.com/zoubin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# index-hashify\n[![version](https://img.shields.io/npm/v/index-hashify.svg)](https://www.npmjs.org/package/index-hashify)\n[![status](https://travis-ci.org/zoubin/index-hashify.svg)](https://travis-ci.org/zoubin/index-hashify)\n[![dependencies](https://david-dm.org/zoubin/index-hashify.svg)](https://david-dm.org/zoubin/index-hashify)\n[![devDependencies](https://david-dm.org/zoubin/index-hashify/dev-status.svg)](https://david-dm.org/zoubin/index-hashify#info=devDependencies)\n\nA [browserify] plugin to replace numeric indexes with hashes.\n\n## The problem with numeric hashes\n[browserify] uses numbers to identify module functions in the final bundle by default.\nSince modules are sorted according to their file paths,\nand those identification numbers are just their corresponding indexes in the sorted array (in most cases),\nthey are prone to changing when dependencies inserted and deleted.\n\nSuppose there are two modules `'/a.js'` and `'/c.js'`,\nwhich will get `1` and `2` as their identification number in the final bundle, respectively.\nNow if we add `require('/b.js')` in `'a.js'`,\n`'/c.js'` will get `3` as its identification number even if nothing happens to the original module.\n\nThat may cause problems in some cases:\n* common shared bundles.\n  When using [factor-bundle], the contents of the common bundle may change due to just the change of identification numbers,\n  invalidating the application cache for it.\n* hot module replacement.\n  Tools like [browserify-hmr] replace changed modules, but not those who just suffer a identification number change,\n  thus breaking the dependency chain. (See [browserify-hmr#28](https://github.com/AgentME/browserify-hmr/issues/28))\n\n\nThis plugin will take the sha1 of the result of concating the file path (relative to `basedir`) with the contents of the module \nas the identification number instead, which will not change as long as the module keeps,\nthus fixing the above problems.\n\n## Usage\n\n```javascript\nvar b = browserify(opts)\nvar hashify = require('index-hashify')\nb.plugin(hashify)\nb.bundle().pipe(process.stdout)\n\n```\n\n[browserify]: https://github.com/substack/node-browserify\n[factor-bundle]: https://github.com/substack/factor-bundle\n[browserify-hmr]: https://github.com/AgentME/browserify-hmr\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Findex-hashify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoubin%2Findex-hashify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Findex-hashify/lists"}