{"_id":"@afuggini/tabsync","_rev":"1-cf60c57244869ae60a72f5a43e50286d","name":"@afuggini/tabsync","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@afuggini/tabsync","version":"0.0.1","description":"Allows all browser tabs to be aware of other open tabs","keywords":["tab","browser","sync"],"author":{"name":"Ariel Fuggini","email":"ariel@fuggini.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/afuggini/tabsync.git"},"main":"lib/index.js","types":"lib/index.d.ts","scripts":{"clean":"rm -rf dist lib build coverage","dev":"parcel demo/index.html demo/worker.ts","lint":"eslint --ext .ts src","lint:fix":"npm run lint -- --fix","test:unit":"jest --passWithNoTests","test:watch":"npm run jest -- --watch","test":"npm run lint && npm run test:unit","watch":"nodemon","build":"npm run clean && tsc","prepublishOnly":"npm run test && npm run build"},"devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@types/jest":"^26.0.0","@types/node":"^14.6.0","@typescript-eslint/eslint-plugin":"^4.15.0","@typescript-eslint/parser":"^4.15.0","eslint":"^7.3.1","eslint-config-prettier":"^7.2.0","eslint-plugin-import":"^2.21.2","husky":"^5.0.9","jest":"^26.0.1","lint-staged":"^10.2.11","nodemon":"^2.0.4","parcel-bundler":"^1.12.4","prettier":"^2.0.5","ts-jest":"^26.1.1","ts-node":"^9.0.0","typescript":"^4.1.5"},"husky":{"hooks":{"pre-commit":"lint-staged && npm run build","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"lint-staged":{"*.ts":["eslint --fix","prettier --write"],"*.{json,md}":["prettier --write"]},"bugs":{"url":"https://github.com/afuggini/tabsync/issues"},"homepage":"https://github.com/afuggini/tabsync#readme","directories":{"lib":"lib"},"gitHead":"75ff5d43f0b4a22ddbbecee1162a3d9f5320d6f0","_id":"@afuggini/tabsync@0.0.1","_nodeVersion":"12.18.2","_npmVersion":"7.5.4","dist":{"integrity":"sha512-tuQVRZj7TQHwpniJOqH89GvN3wE4da4LDFrynGMHskqYnhfJkqYrmlTUVabPQfxj+3EMUtondjR3bNp+4rPugw==","shasum":"196525f8b3e258997911d874be4f089c44cc9c61","tarball":"https://registry.npmjs.org/@afuggini/tabsync/-/tabsync-0.0.1.tgz","fileCount":18,"unpackedSize":14174,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL/DwCRA9TVsSAnZWagAAtxQP/iLGzFDMNgOCHZCugS2e\nUDdUZyKySQrbJUBZAS0hlpaiBhX/M0bMfvERMxRCeTwoScizaHm2MZ3iT4l3\ncYFCPZbLD5M6W05tC9hV2iO8sYUAZjfA/UDFI+Nc18wsunqBDAF8ihot17sU\noPlpaI9SpyLXQy1E8FXEOLVX7RqS+RLVpiuo0bVqjtPwF+J/FjXeUm9TWDMc\n54/fwKyyHal+Gn31qJTX8KMabhbvRv+NgQ8vPn4HqBP1A0RwPFVuCwDQPX8S\naSqjFE8yHS2TOZWjEUTk5zviTtokMdOqtA7hykRfrwvavEw9HZu+9ZiY6/M7\nNPa18vtkg7C94MO21lGt9P3W2OlkVec8blJeO4bjZgy1d0mCEEUhvJx2cH0i\n24dtM0TphfsNSL4cKNbOUM88AVaWL6Off6jI8ulVkObP1ujii4v8bO5H8NWO\nL8m5I5vW7xOXGpze+f5eJErY47lpWOTR/02EwaNRK8HN9VpEGsbY0tUdrDz3\n7BwNm+01hsrEKL4y3wP/prnIvzgyQJiMPfgaEW+eMl+B01nCU9o/rLz4TL8Q\nCtIOpNx/KNwoquEsnT9WCMQMRlho9ssUBB9Arwl/zqMKOzH/LNlooYIYeD7/\nFpTxHiabQNuvC3YwimzthweMX+JSuPQEzXq+0kFJsS1TAw3srnDY4MOHb89J\nbKvw\r\n=oTCU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFG5/Y8M2MnSANDw/0XPVuCeEG+C+/1c4j16BRO0MykXAiEAyIK+IBkJgSFXRAtMRcOIW55cYl/rMDHeMVa/4JN+4l8="}]},"_npmUser":{"name":"afuggini","email":"ariel@fuggini.com"},"maintainers":[{"name":"afuggini","email":"ariel@fuggini.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tabsync_0.0.1_1613754607780_0.000597133773372116"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-19T17:10:07.716Z","0.0.1":"2021-02-19T17:10:07.889Z","modified":"2022-04-04T11:52:51.936Z"},"maintainers":[{"name":"afuggini","email":"ariel@fuggini.com"}],"description":"Allows all browser tabs to be aware of other open tabs","homepage":"https://github.com/afuggini/tabsync#readme","keywords":["tab","browser","sync"],"repository":{"type":"git","url":"git+https://github.com/afuggini/tabsync.git"},"author":{"name":"Ariel Fuggini","email":"ariel@fuggini.com"},"bugs":{"url":"https://github.com/afuggini/tabsync/issues"},"license":"MIT","readme":"# @afuggini/tabsync\n\n[![GitHub license](https://img.shields.io/github/license/afuggini/tabsync)](https://github.com/afuggini/tabsync/blob/master/LICENSE)\n\nAllows browser tabs to be aware of other open tabs.\n\n## Usage\n\nCreate a shared worker:\n\n```javascript\n// worker.js\nimport { TabSyncWorker } from '@afuggini/tabsync';\n\nnew TabSyncWorker({ channelName: 'demo-project' });\n```\n\nInstance the `TabSync` class to communicate with the worker:\n\n```javascript\nimport TabSync from '@afuggini/tabsync';\n\nnew TabSync({\n  // Same name as in the worker\n  channelName: 'demo-project',\n\n  // Unique ID for each tab\n  id: randomId(),\n\n  // How often to ping the worker to report tab is alive (defaults to 1000)\n  pingInterval: 1000,\n\n  // Path to the worker.js file created before\n  workerPath: './worker.js',\n\n  // Called every time a new tab is opened, including the current one (optional)\n  onInit: (data) => {\n    console.log(`Tab initialized:`, data);\n  },\n\n  // Called when a tab is closed by the user (optional)\n  onKill: (data) => {\n    console.log(`Tab killed:`, data);\n  },\n\n  // Called when the tab has crashed or closed unexpectedly (optional)\n  onPrune: (data) => {\n    console.log(`Tab pruned:`, data);\n  },\n});\n```\n\n## Demo\n\nA demo implementation can be found in the `/demo` directory.\n\nTo run locally:\n\n1. Run `yarn dev`\n2. Open http://localhost:1234/index.html\n3. Open multiple tabs and inspect the Dev Tools console\n\n## License\n\nMIT\n","readmeFilename":"README.md"}