{"_id":"@azamanaza/window-history-service","_rev":"6-a8217afbf26b5c7b558cc98df334b8f2","time":{"created":"2021-05-20T01:05:46.074Z","1.0.1":"2021-05-20T01:05:46.286Z","modified":"2022-04-04T17:15:22.225Z"},"name":"@azamanaza/window-history-service","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@azamanaza/window-history-service","version":"1.0.1","repository":{"type":"git","url":"git+https://github.com/azamanaza/window-history-service.git"},"bugs":{"url":"https://github.com/azamanaza/window-history-service/issues"},"homepage":"https://github.com/azamanaza/window-history-service","keywords":["javascript","typescript","window history"],"description":"## Description A small service that wraps the window.history object and provides convenience for manipuating the url history without triggering redirection.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"author":{"name":"Miguel Felipe Calo","email":"miguelc0611@yahoo.com"},"license":"ISC","devDependencies":{"typescript":"^4.2.4"},"gitHead":"cc4e952508beee3eac36dcb28ace6bbf9a6af075","_id":"@azamanaza/window-history-service@1.0.1","_nodeVersion":"14.16.0","_npmVersion":"7.11.1","dist":{"integrity":"sha512-I3oJA7pFzeCcbzpYOIpFYwhvZpH+f+5hnCUexMJ3RdUmbqKVEiD55rcNez2iguK879OgGpjsTenU9gtv8QbRpQ==","shasum":"b55a1f51ae5a3fa87391b0848399c5472dc7c63c","tarball":"https://registry.npmjs.org/@azamanaza/window-history-service/-/window-history-service-1.0.1.tgz","fileCount":4,"unpackedSize":4194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpbXqCRA9TVsSAnZWagAALJAQAJ9/UfnjbuDAuIbvUbbZ\nYi1n2P6IoI5BeW5oBa1EzGvbbtjZu+pMNrWvqAV+UACbtmurmDjJddNgH556\njESpCS+8fSGSucZHWtSgPTUpF3K5VmUjbaz1WlC+yyxXC+zolQevKpJ6/aER\nbBWNjiPkSGeHbWqddu5XJWVl7BtyMX1n2EnerhSTj5Q6ccMwgjafPllAzCjl\nB0QiIBn8Pnh4I3xHzji3Qt9Nv1lAUlPbh+iQ4Vuds4h89Ya/vFTB8P+Xk63s\nD2gSTVoyMi4ZGWOffGlZcUDTrb4jYhyhIqsXl0FvsoNnfjZi9sNt9Ic+vfTo\nMItwSnmuvqtvBEco4Vc2+AW5bKjOpivd+uce7ULYXGTCJ0P8vZ1Y8Q65+Pt4\nuqItbMCbBD7s1/c0QTTJ2IalqNgbOXHeRTYOEXBqcmRjmUav7XvDSArwIig4\na26fuSvdeV0mzTtHq8tVIs5yY9QYysfUfRH9702mdDNxV+9rnMDz5Df6fHW5\naVD+1U/1OEZn2QFP5MhN8f4pZFJ5gydIIkjghRbNYow1PNh+Dx14KxeLrQRi\nZ6PjCSrDTVN8cCzEulVMdGU2L2+XhCGKYplndYbKx16kvV3dpH3QbJ0aqWfl\nd09mKZ8AOOcio68OJbu8nMExFbXIKdbJ/9JV3LXeH9VxAT6dmiQPuXh+iNwf\nv9Ep\r\n=pSyy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAlNGp4g45LCQKaZxa3D8iTD+N4EfmR7e1jZOqHS6W2LAiEAzdk/PRUhRWc+9PtjadmsAT+vncyErveaWDP2sihh9Hk="}]},"_npmUser":{"name":"azamanaza","email":"miguelc0611@yahoo.com"},"directories":{},"maintainers":[{"name":"azamanaza","email":"miguelc0611@yahoo.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/window-history-service_1.0.1_1621472746148_0.4301193267589791"},"_hasShrinkwrap":false}},"maintainers":[{"name":"azamanaza","email":"miguelc0611@yahoo.com"}],"description":"## Description A small service that wraps the window.history object and provides convenience for manipuating the url history without triggering redirection.","homepage":"https://github.com/azamanaza/window-history-service","keywords":["javascript","typescript","window history"],"repository":{"type":"git","url":"git+https://github.com/azamanaza/window-history-service.git"},"author":{"name":"Miguel Felipe Calo","email":"miguelc0611@yahoo.com"},"bugs":{"url":"https://github.com/azamanaza/window-history-service/issues"},"license":"ISC","readme":"# @azamanaza/window-history-service\n\n## Description\nA small service that wraps the window.history object and provides convenience for manipuating the url history without triggering redirection.\n\n## Setup\nRun `npm i @azamanaza/window-history-service`\n\n## Usage\n\n### getCurrentParams()\nRetrieves the current query params on the address bar.\n```\n// localhost?foo=a&baz=b\n\ncosnt service = new WindowHistoryService()\nservice.getCurrentParams() // { foo: \"a\", baz: \"b\" }\n```\n\n### removeQueryParam(key: string)\nRemoves a parameter by key.\nNote: you need to call `applyChanges()` to trigger the update.\n```\n// localhost?foo=a&baz=b\ncosnt service = new WindowHistoryService()\nservice.removeQueryParam('foo').applyChanges()\n// localhost?baz=b\n```\n\n### setQueryParam(key: string, val: string | number)\nAdds or updates a parameter to the query\nNote: you need to call `applyChanges()` to trigger the update.\n```\n// localhost?foo=a&baz=b\ncosnt service = new WindowHistoryService()\nservice.setQueryParam('bar', 'c').applyChanges()\n// localhost?foo=a&baz=b&bar=c\n```\n\n### setQueryParams(param: QueryParams)\nReplaces the entire query list\nNote: you need to call `applyChanges()` to trigger the update.\n```\n// localhost?foo=a&baz=b\ncosnt service = new WindowHistoryService()\nservice.setQueryParams({ a: 1, b: \"two\", c: 3 }).applyChanges()\n// localhost?a=1&b=two&c=3\n```\n\n### applyChanges()\nApplies the changes to the address bar.\n\n### generateUrl()\nAssembles the full url along with the query string parameters\n```\n// localhost?foo=a&baz=b\ncosnt service = new WindowHistoryService()\nservice.generateUrl() // http://localhost?foo=a&baz=b\n```\n\n### getPath()\nGets the path part of the url (without host and protocl)\n```\n// localhost/home\ncosnt service = new WindowHistoryService()\nservice.getPath() // /home\n```","readmeFilename":"README.md"}