{"_id":"should-handle-link","_rev":"5-57c325f4213e8a08dc0c04c9d5fce8bd","name":"should-handle-link","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"should-handle-link","version":"1.0.0","keywords":["link","handle","navigation","spa","mpa","routing","router"],"author":{"name":"NullVoxPopuli"},"license":"MIT","_id":"should-handle-link@1.0.0","maintainers":[{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"}],"dist":{"shasum":"f6935a79fedd2d68a5a14c740d7f6c0d8b6cf397","tarball":"https://registry.npmjs.org/should-handle-link/-/should-handle-link-1.0.0.tgz","fileCount":4,"integrity":"sha512-BTtxNNnKG73icAJ7O9DS9VQT6ZZpTJc4LLe7ttIP7YdLpPv6UGE1Y68ByGBB0qJcW0CNzyeED8JoAwPjzyYw9g==","signatures":[{"sig":"MEQCIErmNAcnwxHekIyCIdxv4R42GmgwNPcrmfAWRVoW7oNqAiAMBIh+KYb3YbyosQrcfVakyMORajUjjSKQOYVJ8HniWw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4727},"main":"index.js","type":"module","_from":"file:should-handle-link-1.0.0.tgz","types":"index.d.ts","_npmUser":{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"},"_resolved":"/tmp/5a6f4587c6a2573c5d4292f9dc13b7f0/should-handle-link-1.0.0.tgz","_integrity":"sha512-BTtxNNnKG73icAJ7O9DS9VQT6ZZpTJc4LLe7ttIP7YdLpPv6UGE1Y68ByGBB0qJcW0CNzyeED8JoAwPjzyYw9g==","_npmVersion":"10.2.3","description":"A utility to help libraries and frameworks handle `<a>` clicks, properly handling all the default behavior that comes with clicking links (ctrl+click, cmd+click, etc).","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/should-handle-link_1.0.0_1723691733673_0.9867131424298738","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"should-handle-link","version":"1.1.0","keywords":["link","handle","navigation","spa","mpa","routing","router"],"author":{"name":"NullVoxPopuli"},"license":"MIT","_id":"should-handle-link@1.1.0","maintainers":[{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"}],"homepage":"https://github.com/NullVoxPopuli/should-handle-link#readme","bugs":{"url":"https://github.com/NullVoxPopuli/should-handle-link/issues"},"dist":{"shasum":"9d0754667c4924d57d02fe61bbb0b5d18632f577","tarball":"https://registry.npmjs.org/should-handle-link/-/should-handle-link-1.1.0.tgz","fileCount":10,"integrity":"sha512-18poFzoRU7NWS/pMnIUBVWEYn/aUW+MbV5+0p9wnbw8zGoEvcCIlRjZcoVRQMTpiF2oUmuvopdbWJkUcTZsLzA==","signatures":[{"sig":"MEUCIF28S/vQsLBtog7++Z9Q1Z9yohZuKKWjS6CbXT5YWaHpAiEAllgIwwUKSvbdzaY8knk+zJFj1ihCfNxtM/1KErLzBao=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15760},"main":"index.js","type":"module","_from":"file:should-handle-link-1.1.0.tgz","types":"index.d.ts","_npmUser":{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"},"_resolved":"/tmp/d7721930cb0e7eac8d5801f564c88309/should-handle-link-1.1.0.tgz","_integrity":"sha512-18poFzoRU7NWS/pMnIUBVWEYn/aUW+MbV5+0p9wnbw8zGoEvcCIlRjZcoVRQMTpiF2oUmuvopdbWJkUcTZsLzA==","repository":{"url":"git+ssh://git@github.com/NullVoxPopuli/should-handle-link.git","type":"git"},"_npmVersion":"10.7.0","description":"A utility to help libraries and frameworks handle `<a>` clicks, properly handling all the default behavior that comes with clicking links (ctrl+click, cmd+click, etc).","directories":{},"_nodeVersion":"18.20.4","_hasShrinkwrap":false,"devDependencies":{"release-plan":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/should-handle-link_1.1.0_1723736936296_0.08298047945933384","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"should-handle-link","version":"1.2.0","keywords":["link","handle","navigation","spa","mpa","routing","router"],"author":{"name":"NullVoxPopuli"},"license":"MIT","_id":"should-handle-link@1.2.0","maintainers":[{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"}],"homepage":"https://github.com/NullVoxPopuli/should-handle-link#readme","bugs":{"url":"https://github.com/NullVoxPopuli/should-handle-link/issues"},"dist":{"shasum":"1868df639dffeba973d0655c363300a00b90f59a","tarball":"https://registry.npmjs.org/should-handle-link/-/should-handle-link-1.2.0.tgz","fileCount":10,"integrity":"sha512-6lXq7k7LQr5lJzGlj6NsWx0lntPTAQ0FF+PamZvpGTsbAvV0OqU/MIAJse5hSfW7wV3kRewWIJq6qZxfoiMa7A==","signatures":[{"sig":"MEYCIQCayzQxAlhL2RCKkAyNJ/Irkm6+DoRRKKu4yy8dZkoZIwIhAL/vC32uhS/3hIa8x7FQ7Mfts2WjXIyfdmjmVoNF9MLF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15815},"main":"index.js","type":"module","_from":"file:should-handle-link-1.2.0.tgz","types":"index.d.ts","_npmUser":{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"},"_resolved":"/tmp/1b538c2e10d73ddfd59a4002359e55f2/should-handle-link-1.2.0.tgz","_integrity":"sha512-6lXq7k7LQr5lJzGlj6NsWx0lntPTAQ0FF+PamZvpGTsbAvV0OqU/MIAJse5hSfW7wV3kRewWIJq6qZxfoiMa7A==","repository":{"url":"git+ssh://git@github.com/NullVoxPopuli/should-handle-link.git","type":"git"},"_npmVersion":"10.7.0","description":"A utility to help libraries and frameworks handle `<a>` clicks, properly handling all the default behavior that comes with clicking links (ctrl+click, cmd+click, etc).","directories":{},"_nodeVersion":"18.20.4","_hasShrinkwrap":false,"devDependencies":{"release-plan":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/should-handle-link_1.2.0_1723738075859_0.01683175832339079","host":"s3://npm-registry-packages"}},"1.2.1":{"name":"should-handle-link","version":"1.2.1","keywords":["link","handle","navigation","spa","mpa","routing","router"],"author":{"name":"NullVoxPopuli"},"license":"MIT","_id":"should-handle-link@1.2.1","maintainers":[{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"}],"homepage":"https://github.com/NullVoxPopuli/should-handle-link#readme","bugs":{"url":"https://github.com/NullVoxPopuli/should-handle-link/issues"},"dist":{"shasum":"eb2c8daf59ef00f7dc7249271fbab713b136b407","tarball":"https://registry.npmjs.org/should-handle-link/-/should-handle-link-1.2.1.tgz","fileCount":5,"integrity":"sha512-So8OAtM1CEMpdyFuoT1eGix817E2d7kuediBcElvpQx3FwwteClo5B6DUzywL/GAXZ4+JJ69B3J4hirFiKughA==","signatures":[{"sig":"MEQCIG70cvkb7Hw3hWiRJr3pTK/z2Qv6i6515aq0ESW0EQSqAiBLDKYJVXVFN1EyJIyfYXr1wNFMWjoPzXSNsquyyl2HaQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8263},"main":"src/index.js","type":"module","_from":"file:should-handle-link-1.2.1.tgz","types":"src/index.d.ts","module":"src/index.js","exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"}},"scripts":{"lint":"concurrently 'pnpm:lint:*(!fix)' --names 'lint:'","lint:js":"eslint . --cache","lint:fix":"concurrently 'pnpm:lint:*:fix' --names 'fix:'","lint:types":"tsc --noEmit --emitDeclarationOnly false","lint:js:fix":"eslint . --fix","lint:package":"publint .","lint:published-types":"attw . --pack --ignore-rules cjs-resolves-to-esm"},"_npmUser":{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"},"_resolved":"/tmp/ab469d2ae59c075553d883e27d967fda/should-handle-link-1.2.1.tgz","_integrity":"sha512-So8OAtM1CEMpdyFuoT1eGix817E2d7kuediBcElvpQx3FwwteClo5B6DUzywL/GAXZ4+JJ69B3J4hirFiKughA==","repository":{"url":"git+https://github.com/NullVoxPopuli/should-handle-link.git","type":"git"},"_npmVersion":"10.7.0","description":"A utility to help libraries and frameworks handle `<a>` clicks, properly handling all the default behavior that comes with clicking links (ctrl+click, cmd+click, etc).","directories":{},"_nodeVersion":"18.20.4","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.0.0","publint":"^0.2.10","prettier":"^3.3.3","typescript":"^5.5.4","concurrently":"^8.2.2","release-plan":"^0.9.0","@tsconfig/ember":"^3.0.8","eslint-plugin-ember":"^12.1.1","eslint-plugin-qunit":"^8.1.1","@babel/eslint-parser":"^7.25.1","@arethetypeswrong/cli":"^0.15.4","@typescript-eslint/parser":"^8.1.0","@nullvoxpopuli/eslint-configs":"^4.2.0","@typescript-eslint/eslint-plugin":"^8.1.0"},"_npmOperationalInternal":{"tmp":"tmp/should-handle-link_1.2.1_1723744677549_0.48681016235638985","host":"s3://npm-registry-packages"}},"1.2.2":{"name":"should-handle-link","version":"1.2.2","keywords":["link","handle","navigation","spa","mpa","routing","router"],"author":{"name":"NullVoxPopuli"},"license":"MIT","_id":"should-handle-link@1.2.2","maintainers":[{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"}],"homepage":"https://github.com/NullVoxPopuli/should-handle-link#readme","bugs":{"url":"https://github.com/NullVoxPopuli/should-handle-link/issues"},"dist":{"shasum":"26155601a3f181d38a1cdb4075c5f6cc10bdb61c","tarball":"https://registry.npmjs.org/should-handle-link/-/should-handle-link-1.2.2.tgz","fileCount":5,"integrity":"sha512-9PElHBcPIkoMMCC76vvO784Ki0uHfrmEXUDm14/A60YZudK/cUmiP7sAfw74QFIjn7Ej1fu5tn3q4OZNViiJUA==","signatures":[{"sig":"MEUCIB/gbYQJnR217agiYAYFMKqLQ9frPjGPvpjwK/bFow+DAiEAi5S+LiQHpdrWBPvFnLNww/fYpPs3S6Msomgbwj479Qc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8622},"main":"src/index.js","type":"module","_from":"file:should-handle-link-1.2.2.tgz","types":"src/index.d.ts","module":"src/index.js","exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"}},"scripts":{"lint":"concurrently 'pnpm:lint:*(!fix)' --names 'lint:'","lint:js":"eslint . --cache","lint:fix":"concurrently 'pnpm:lint:*:fix' --names 'fix:'","lint:types":"tsc --noEmit --emitDeclarationOnly false","lint:js:fix":"eslint . --fix","lint:package":"publint .","lint:published-types":"attw . --pack --ignore-rules cjs-resolves-to-esm"},"_npmUser":{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"},"_resolved":"/tmp/8c531ccf66e634eac912624a1d0e7f23/should-handle-link-1.2.2.tgz","_integrity":"sha512-9PElHBcPIkoMMCC76vvO784Ki0uHfrmEXUDm14/A60YZudK/cUmiP7sAfw74QFIjn7Ej1fu5tn3q4OZNViiJUA==","repository":{"url":"git+https://github.com/NullVoxPopuli/should-handle-link.git","type":"git"},"_npmVersion":"10.7.0","description":"A utility to help libraries and frameworks handle `<a>` clicks, properly handling all the default behavior that comes with clicking links (ctrl+click, cmd+click, etc).","directories":{},"_nodeVersion":"18.20.4","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.0.0","publint":"^0.2.10","prettier":"^3.3.3","typescript":"^5.5.4","concurrently":"^8.2.2","release-plan":"^0.9.0","@tsconfig/ember":"^3.0.8","eslint-plugin-ember":"^12.1.1","eslint-plugin-qunit":"^8.1.1","@babel/eslint-parser":"^7.25.1","@arethetypeswrong/cli":"^0.15.4","@typescript-eslint/parser":"^8.1.0","@nullvoxpopuli/eslint-configs":"^4.2.0","@typescript-eslint/eslint-plugin":"^8.1.0"},"_npmOperationalInternal":{"tmp":"tmp/should-handle-link_1.2.2_1729044217949_0.34301943344633057","host":"s3://npm-registry-packages"}},"1.3.0":{"name":"should-handle-link","version":"1.3.0","description":"A utility to help libraries and frameworks handle `<a>` clicks, properly handling all the default behavior that comes with clicking links (ctrl+click, cmd+click, etc).","keywords":["link","handle","navigation","spa","mpa","routing","router"],"repository":{"type":"git","url":"git+https://github.com/NullVoxPopuli/should-handle-link.git"},"license":"MIT","author":{"name":"NullVoxPopuli"},"type":"module","main":"src/index.js","module":"src/index.js","types":"src/index.d.ts","exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"}},"devDependencies":{"@arethetypeswrong/cli":"^0.15.4","@babel/eslint-parser":"^7.25.1","@nullvoxpopuli/eslint-configs":"^4.2.0","@tsconfig/ember":"^3.0.8","@typescript-eslint/eslint-plugin":"^8.1.0","@typescript-eslint/parser":"^8.1.0","concurrently":"^8.2.2","eslint":"^8.0.0","eslint-plugin-ember":"^12.1.1","eslint-plugin-qunit":"^8.1.1","prettier":"^3.3.3","publint":"^0.2.10","release-plan":"^0.9.0","typescript":"^5.5.4"},"scripts":{"lint":"concurrently 'pnpm:lint:*(!fix)' --names 'lint:'","lint:fix":"concurrently 'pnpm:lint:*:fix' --names 'fix:'","lint:js":"eslint . --cache","lint:js:fix":"eslint . --fix","lint:types":"tsc --noEmit --emitDeclarationOnly false","lint:package":"publint .","lint:published-types":"attw . --pack --ignore-rules cjs-resolves-to-esm"},"_id":"should-handle-link@1.3.0","bugs":{"url":"https://github.com/NullVoxPopuli/should-handle-link/issues"},"homepage":"https://github.com/NullVoxPopuli/should-handle-link#readme","_integrity":"sha512-1+VHDYKARWyq1gL4nYVcLWk893m4PLgWPa41f/9Tt+AKJSt0B1dZ+HN6w7fQJ/v2vLC8rwJkyOUF8ijcsNSdaA==","_resolved":"/tmp/ee28ca5c317ba7f9f307b4b69b66186d/should-handle-link-1.3.0.tgz","_from":"file:should-handle-link-1.3.0.tgz","_nodeVersion":"18.20.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-1+VHDYKARWyq1gL4nYVcLWk893m4PLgWPa41f/9Tt+AKJSt0B1dZ+HN6w7fQJ/v2vLC8rwJkyOUF8ijcsNSdaA==","shasum":"b2ba8cc736ecad035c5cdad9c338a887dd68b75a","tarball":"https://registry.npmjs.org/should-handle-link/-/should-handle-link-1.3.0.tgz","fileCount":5,"unpackedSize":8796,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDvfv1cyxb+sb186nlIZLKcR3QsQa7Ad+B1C2CN0t8zwIhAPgg3zSqm62CuGE94Azt4WvXjTv8UE/jUR111UZJcWjt"}]},"_npmUser":{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"},"directories":{},"maintainers":[{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/should-handle-link_1.3.0_1732203454924_0.7777722132960658"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-15T03:15:33.673Z","modified":"2024-11-21T15:37:35.269Z","1.0.0":"2024-08-15T03:15:33.824Z","1.1.0":"2024-08-15T15:48:56.461Z","1.2.0":"2024-08-15T16:07:56.021Z","1.2.1":"2024-08-15T17:57:57.705Z","1.2.2":"2024-10-16T02:03:38.176Z","1.3.0":"2024-11-21T15:37:35.077Z"},"bugs":{"url":"https://github.com/NullVoxPopuli/should-handle-link/issues"},"author":{"name":"NullVoxPopuli"},"license":"MIT","homepage":"https://github.com/NullVoxPopuli/should-handle-link#readme","keywords":["link","handle","navigation","spa","mpa","routing","router"],"repository":{"type":"git","url":"git+https://github.com/NullVoxPopuli/should-handle-link.git"},"description":"A utility to help libraries and frameworks handle `<a>` clicks, properly handling all the default behavior that comes with clicking links (ctrl+click, cmd+click, etc).","maintainers":[{"name":"nullvoxpopuli","email":"theprecognition+npm@gmail.com"}],"readme":"# should-handle-link\n\nA utility to help libraries and frameworks handle `<a>` clicks, properly handling all the default behavior that comes with clicking links (ctrl+click, cmd+click, etc).\n\nThis allows folks to usue a single event listener on the document to handle all the links in their app.\n\n\n## Installation\n\n```bash\npnpm add should-handle-link\n```\n\n## Usage\n\n```js\nimport { shouldHandle, getAnchor } from 'should-handle-link';\n\nfunction handler(event) {\n    let anchor = getAnchor(event);\n\n    if (!shouldHandle(location.href, anchor, event)) {\n        return;\n    }\n\n    event.preventDefault();\n    event.stopImmediatePropagation();\n    event.stopPropagation();\n    // Do single-page-app routing, \n    // or some other manual handling of the clicked anchor element\n}\n\ndocument.body.addEventListener('click', handler);\n```\n\n## License \n\nMIT\n\n## Related projects \n\n- [internal-nav-helper](https://github.com/HenrikJoreteg/internal-nav-helper)\n    This porject has narrower scope and doesn't cover as many use cases (and is also outdated).\n","readmeFilename":"README.md"}