{"versions":{"1.0.0-alpha.0":{"name":"fetch-event-source","description":"Fetch implementation of EventSource with more functionality such as HTTP headers and support for Node.js.","version":"1.0.0-alpha.0","license":"MIT","keywords":["sse"],"main":"./index.js","module":"./index.es.js","types":"./types/index.d.ts","scripts":{"prebuild":"rimraf -rf dist/*","build":"npm run build:types && npm run build:js","build:types":"tsc --emitDeclarationOnly","build:js":"rollup -c build/rollup.config.js","test":"jest","testw":"jest --watchAll","prepublishOnly":"npm build","start":"node server.js"},"dependencies":{"abort-controller":"^3.0.0","event-target-shim":"^5.0.1","is-absolute-url":"^3.0.3","node-fetch":"^2.6.1","web-streams-polyfill":"^3.0.0"},"devDependencies":{"@babel/compat-data":"^7.11.0","@babel/core":"^7.11.1","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-private-methods":"^7.10.4","@babel/preset-env":"^7.11.0","@babel/preset-typescript":"^7.10.4","@babel/register":"^7.10.5","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-commonjs":"^15.1.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-node-resolve":"^9.0.0","@types/jest":"^26.0.9","@types/node-fetch":"^2.5.7","@typescript-eslint/eslint-plugin":"^3.9.0","@typescript-eslint/parser":"^3.9.0","eslint":"^7.6.0","eslint-config-airbnb":"18.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.5","eslint-plugin-react-hooks":"^4.0.8","jest":"^26.3.0","rimraf":"^3.0.2","rollup":"^2.28.2","rollup-plugin-copy":"^3.3.0","rollup-plugin-node-externals":"^2.2.0","rollup-plugin-terser":"^7.0.2","typescript":"^4.0.3"},"resolutions":{"terser":"5.3.4"},"jest":{"testEnvironment":"node"},"_id":"fetch-event-source@1.0.0-alpha.0","_nodeVersion":"14.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-QNz2nX0d5zA8LO7cnUaoBEEv8xNlqlmNI+VRMpdTjkDB5bxHDJhzIUXtzU47LGVEPK+bc+TdcNRqh+V3D0ftJQ==","shasum":"272204c69226d9a8ec3d4e09d2c2ee2590404a6a","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fetch-event-source/-/fetch-event-source-1.0.0-alpha.0.tgz","fileCount":16,"unpackedSize":110909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhF4tCRA9TVsSAnZWagAAh10P/RJ631ppHdCTzx1OdGOm\nJiIMPl+KYHPFq25NClDRSCL5Yp9kp0w+4BaFIEAsgFvNzTV2afLa/vqUGpli\nd7jAya4LIWfEb1UbyPJOD8iZ+vUBIHyWiDnIJH/QMV2SIZnQJc+Uke79zWai\nh320GMxJFvUD44JiMtF9o7J0ph8lbEHLD4xVMYRGW7X5c5JsjMEzqC3EiBpY\n5Fhj1lDqeuqyr5sDVLiJxTPHFp4u2ya1cLuDcTYpshN1IeJE0dTxJY2WmnmF\nzOYtr4HMoUf8+qtuewOPC52BTi4QlQLVF4xbwiZZ8BkxXj8ZFu6uoSHqvis/\n3QXrmebO1v+mbaV18k/+o4QghYltEUSGNUgTHAmtfQ8NXwqdLRuWQkiPZjJ+\n4zioS3/zlvP1lTEDZRc6iKZ6xeTfmHOwpBUqBVarxig8uL3dVQkLcqDtlGL7\n9F7KJO/xlOyDZkFzVU2jv+X52E2hZtCylxcNQemY4WX/cfZIT+UL+O7zJ9C1\nfmwwFUyPJigs7xdS+4kdBsQie0VLLHg0AyBHjkE3U0NWa7AErXWnDA2ueukD\nm28yGx1xfVHic2iPHveJb8CcDleAb3XlnZFCvCe6j2vAG7tP5gDzwzaRlwzb\n36BbgElCNvH30/WkZocmXgDbRnB1cKXJsky2zRZA3eZ8u/SM3uCtFgIi3Loo\njIye\r\n=7DzO\r\n-----END PGP SIGNATURE-----\r\n","size":16202},"maintainers":[{"name":"anonymous","email":"skyllo.dev@gmail.com"}],"_npmUser":{"name":"anonymous","email":"skyllo.dev@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-event-source_1.0.0-alpha.0_1602510381251_0.897895559387969"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-26T18:54:59.597Z","contributors":[]},"1.0.0-alpha.1":{"name":"fetch-event-source","description":"Fetch implementation of EventSource with more functionality such as HTTP headers and support for Node.js.","version":"1.0.0-alpha.1","license":"MIT","keywords":["sse"],"main":"./index.js","module":"./index.es.js","types":"./types/index.d.ts","scripts":{"prebuild":"rimraf -rf dist/*","build":"npm run build:types && npm run build:js","build:types":"tsc --emitDeclarationOnly","build:js":"rollup -c build/rollup.config.js","test":"jest","testw":"jest --watchAll","prepublishOnly":"npm build","start":"node server.js"},"dependencies":{"abort-controller":"^3.0.0","event-target-shim":"^5.0.1","is-absolute-url":"^3.0.3","node-fetch":"^2.6.1","web-streams-polyfill":"^3.0.0"},"devDependencies":{"@babel/compat-data":"^7.11.0","@babel/core":"^7.11.1","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-optional-chaining":"^7.11.0","@babel/plugin-proposal-private-methods":"^7.10.4","@babel/preset-env":"^7.11.0","@babel/preset-typescript":"^7.10.4","@babel/register":"^7.10.5","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-commonjs":"^15.1.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-node-resolve":"^9.0.0","@types/jest":"^26.0.9","@types/node-fetch":"^2.5.7","@typescript-eslint/eslint-plugin":"^3.9.0","@typescript-eslint/parser":"^3.9.0","eslint":"^7.6.0","eslint-config-airbnb":"18.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.5","eslint-plugin-react-hooks":"^4.0.8","jest":"^26.3.0","rimraf":"^3.0.2","rollup":"^2.28.2","rollup-plugin-copy":"^3.3.0","rollup-plugin-node-externals":"^2.2.0","rollup-plugin-terser":"^7.0.2","typescript":"^4.0.3"},"resolutions":{"terser":"5.3.4"},"jest":{"testEnvironment":"node"},"licenseText":"MIT License\n\nCopyright (c) 2020 skyllo\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"fetch-event-source@1.0.0-alpha.1","dist":{"shasum":"a6269e149a5010c0c7683543b8add8e6d8c73c27","integrity":"sha512-SVk4FugODjS6CPYjE0LbmF0g9gbQypLoMizPEH+ho21clm0CHinkxtnQzUlRV5T1p2ooXEDFt403aE44nAe68g==","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fetch-event-source/-/fetch-event-source-1.0.0-alpha.1.tgz","fileCount":23,"unpackedSize":111877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhOjtCRA9TVsSAnZWagAADj8P/1xL2sfIZflTiu/RLi6O\n97mJ4qmbLnXXOc0XJTznGUczufLS7IOTcirXt4dHKtQD5BID/PIJbMdmyWc7\n99eBwstznK3+ZhPI0pa2kcCm42lhuo0Cdx4wRpFX8lonyAEmEUyYFDJZxEJy\nPuKeiVS9nOR1pwjGKJVI7RsvxiBtpuYy/FN2QMAnvWSB62pMCHbKvOxuQikm\nnWjfoKEjDCn0sh3GDNpbHg4nZd9Y4jXNyHpY31IfpUKHwPAA3/jLCV09XNbA\nlQXly63LWxb+lm5Z/9gIs6OS2AsFTI9V8Q5n79livWqdKWtx2uhCpSaiw+wF\nLUnqv2ucBd7VwAIGBGM55MkkX0TyDn7rjis1r7lAFnp5qR3o3uTFg8hD5lLe\nKgrbzoBuOgUuhu4+yiIZzrK+hdZaO8t5KP71Lz9UhVM7NvwoSd0SNjhphkGn\nA9deL/jkmopY9slN1pJTCoKEf3HJyiuMIq1b3+KvVD3j1l397ULhVFWRAx+g\nicEnGRZ7pIWBQ4q0tqXKbsliH7IRnEXYQ/t/GIIjDBRrw9fTlUDrbclAsDYo\ndsv5hVbndGVGIfpwbiSRxf2gJv1TF9jVbHUSUBf/xBmZnyX620/bDJ8cEeSR\nOYNKYnWL9XkuxNFvdQjatil70c7WxlMICorEkZwHppTvqWjAjTRtKOPeNZR8\nzOMG\r\n=Oj+k\r\n-----END PGP SIGNATURE-----\r\n","size":18514},"maintainers":[{"name":"anonymous","email":"skyllo.dev@gmail.com"}],"_npmUser":{"name":"anonymous","email":"skyllo.dev@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-event-source_1.0.0-alpha.1_1602545900496_0.4504213757952149"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-26T18:55:00.466Z","contributors":[]},"1.0.0-alpha.2":{"name":"fetch-event-source","description":"Fetch implementation of EventSource with more functionality such as HTTP headers and support for Node.js.","version":"1.0.0-alpha.2","license":"MIT","keywords":["sse"],"main":"./index.js","module":"./index.es.js","types":"./types/index.d.ts","scripts":{"prebuild":"rimraf -rf dist/*","build":"npm run build:types && npm run build:js","build:types":"tsc --emitDeclarationOnly","build:js":"rollup -c build/rollup.config.js","test":"jest","testw":"jest --watchAll","prepublishOnly":"npm build","start":"node server.js"},"dependencies":{"abort-controller":"^3.0.0","event-target-shim":"^5.0.1","is-absolute-url":"^3.0.3","node-fetch":"^2.6.1","web-streams-polyfill":"^3.0.0"},"devDependencies":{"@babel/compat-data":"^7.11.0","@babel/core":"^7.11.1","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-optional-chaining":"^7.11.0","@babel/plugin-proposal-private-methods":"^7.10.4","@babel/preset-env":"^7.11.0","@babel/preset-typescript":"^7.10.4","@babel/register":"^7.10.5","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-commonjs":"^15.1.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-node-resolve":"^9.0.0","@types/jest":"^26.0.9","@types/node-fetch":"^2.5.7","@typescript-eslint/eslint-plugin":"^3.9.0","@typescript-eslint/parser":"^3.9.0","eslint":"^7.6.0","eslint-config-airbnb":"18.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.5","eslint-plugin-react-hooks":"^4.0.8","jest":"^26.3.0","rimraf":"^3.0.2","rollup":"^2.28.2","rollup-plugin-copy":"^3.3.0","rollup-plugin-node-externals":"^2.2.0","rollup-plugin-terser":"^7.0.2","typescript":"^4.0.3"},"resolutions":{"terser":"5.3.4"},"jest":{"testEnvironment":"node"},"licenseText":"MIT License\n\nCopyright (c) 2020 skyllo\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"fetch-event-source@1.0.0-alpha.2","dist":{"shasum":"f3c0885f55b76396b82b74f94dc74432839fdfc8","integrity":"sha512-tgqOXN6PXk+Az17jTzC2BUgjLltQOxauIqEXfNSx6lCDfyDzqzZMyest7Kxe5AFtXM5x8p7fjiVIujR92Ry6eA==","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fetch-event-source/-/fetch-event-source-1.0.0-alpha.2.tgz","fileCount":23,"unpackedSize":111867,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhZscCRA9TVsSAnZWagAAd0IP/0uKZ+sQx/+P8GAls+gT\n9/pEI3qGyaIPtPmzWRDV+0Xqk9RF5TJ7goSzQNPqKpyRH2xoP+rb8XN/L6xh\njrtrFqYq/e2SGfUqgksKXUU5K2g9hnfUjPqorQx5oZYEO74nRRhSSlzp/iPb\nWprgAK+otg49w5FK1k8VyqvfJtkSs3jn9XgDeMxLI0kVEQ3kXhgm7ZqulKHb\nTxqceMBnefof57mrBC7ed78VwSa+Ahm3HmGp1q9WHUXSH57qUdujR8GnOmPw\n9/0Yq2q4e6ZQqp22hN3OjkiTokjEoBTWDSp5xYCyapxcr5yJoeZ/znf7huw6\npQYDIdPVpyWii6cW8TCDp94HzaQlHbkMFycfMXE3H6ssh0NOetnjk8hu2sEp\nJQkjy/v2Tup2GjTpgng9WyK21cVoYnQjBxacnl8nK91GrXZe8FQ6WRHYo+Db\nF5Okzecl68ASucgqX2Nv/XGmb9eWNR35CGU8hkbEqlxLP/v8P9drL6bC3Kel\nmOuVVeeRJnuuDeOInkyoFgZHG9cYMgA3CcWFBtCCD1KN74xiCL9cBymia9xx\nGt5iOEdvCF0+MxrR6/sULb7QEVw2cvx2t/whf7+tAbwTbouj8Qk2gMSpgFf/\nLNQ4Ts8cMVwJmQcA6C/oRJnaqyBXzEu113aD0gaXG/x7b6aEKzCA8kKbPKTR\nFx23\r\n=CMJq\r\n-----END PGP SIGNATURE-----\r\n","size":18517},"maintainers":[{"name":"anonymous","email":"skyllo.dev@gmail.com"}],"_npmUser":{"name":"anonymous","email":"skyllo.dev@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-event-source_1.0.0-alpha.2_1602591516022_0.5357012558115246"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-26T18:55:01.367Z","contributors":[]}},"dist-tags":{"latest":"1.0.0-alpha.2"},"name":"fetch-event-source","time":{"created":"2022-01-27T10:34:05.875Z","modified":"2022-01-27T10:34:05.875Z","1.0.0-alpha.0":"2020-10-12T13:46:21.405Z","1.0.0-alpha.1":"2020-10-12T23:38:20.652Z","1.0.0-alpha.2":"2020-10-13T12:18:36.191Z"},"readme":"# FetchEventSource\n\n[![FetchEventSource](https://circleci.com/gh/skyllo/fetch-event-source.svg?style=svg)](https://circleci.com/gh/skyllo/fetch-event-source)\n\nFetch implementation of EventSource with more functionality like setting HTTP headers and support for Node.js. Written in TypeScript with the types includes in the package.\n\n# Features\n* Lightweight! 4kb in size (2kb gzip)\n* Tested on latest Safari, Firefox, Chrome on MacOS\n\n# Installation\n```bash\nyarn add fetch-event-source\n```\n\n```bash\nnpm install --save fetch-event-source\n```\n\n# Usage\nThe API is the same as [EventSource](https://developer.mozilla.org/en-US/docs/Web/API/EventSource).\n\n```javascript\nimport FetchEventSource from 'fetch-event-source';\n\nconst eventSource = new FetchEventSource('/sse');\neventSource.addListener('open', () => console.log('SSE Open'));\neventSource.addListener('error', (err) => console.log('SSE Error', err));\neventSource.addListener('message', (e) => console.log('SSE Data', e.data));\n```\n\n## Node.js\n\nYou can import in node using either syntax.\n```javascript\nimport FetchEventSource from 'fetch-event-source/server';\n```\nOr\n```javascript\nconst FetchEventSource = require('fetch-event-source/server');\n```\n\n# API\n## Constructor\n`new FetchEventSource(Config)`\n\n### Config\nTypescript Config Definition\n\n```typescript\ninterface FetchEventSourceConfiguration {\n    /** set custom fetch implementation */\n    fetch?: typeof fetch;\n    /** set custom headers to add to SSE request */\n    headers?: Headers;\n    /** automatically starts the SSE request */\n    autoStart?: boolean;\n    /** send cookies to cross-origin URLs */\n    withCredentials?: boolean;\n    /** initial reconnection delay */\n    reconnectionDelay?: number;\n}\n```\n\n# Testing\nAll tests run using Jest in Node.js using this command.\n\n```javascript\nyarn test\n```\n\n# Similar Projects\n* sse-client: https://github.com/julienmachon/sse-client\n* sse-fetcher: https://github.com/jakearchibald/sse-fetcher","users":{}}