{"_id":"@68publishers/cookie-consent-resolver","_rev":"1-b44e0b4aa08c67c9e6e113cee5023b6e","name":"@68publishers/cookie-consent-resolver","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@68publishers/cookie-consent-resolver","author":{"name":"68publishers"},"version":"1.0.0","description":"Inject scripts without waiting for the cookies widget to load!","private":false,"homepage":"http://www.68publishers.io/","main":"index.mjs","repository":{"type":"git","url":"git+https://github.com/68publishers/cookie-consent-resolver.git"},"keywords":["68publishers","consent","cookieconsent","cookie-consent","cookie-consent-resolver"],"scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","eslint:fix":"eslint ./index.mjs ./src ./__tests__ --ext .js,.mjs --fix","eslint":"eslint ./index.mjs ./src ./__tests__ --ext .js,.mjs","build":"webpack --config webpack.config.js"},"license":"MIT","dependencies":{},"devDependencies":{"@babel/core":"^7.21.8","@babel/polyfill":"^7.12.1","@babel/preset-env":"^7.21.5","babel-loader":"^9.1.2","eslint":"^8.40.0","eslint-plugin-jest":"^27.2.1","jest":"^29.5.0","jest-environment-jsdom":"^29.5.0","terser-webpack-plugin":"^5.3.8","webpack":"^5.82.1","webpack-cli":"^5.1.1"},"jest":{"testEnvironment":"jsdom","testMatch":["**/__tests__/**/*.test.mjs?(x)","**/?(*.)+(spec|test).mjs?(x)"],"moduleFileExtensions":["mjs","js"]},"gitHead":"c0c5cd16fd6712c22f0757d5a139d3841155eb41","bugs":{"url":"https://github.com/68publishers/cookie-consent-resolver/issues"},"_id":"@68publishers/cookie-consent-resolver@1.0.0","_nodeVersion":"19.9.0","_npmVersion":"9.6.3","dist":{"integrity":"sha512-JuIZN19rvZ5kRO7qGeGE7dOJ8YMS/BKd++M3lbKep6mAYKyZdWlnhZivV4DdYB7AY0ihy6bKr1odCmzGNGsILQ==","shasum":"7aa7705bf7b8b8f599dc0a66b2cab2f40d6ad56a","tarball":"https://registry.npmjs.org/@68publishers/cookie-consent-resolver/-/cookie-consent-resolver-1.0.0.tgz","fileCount":5,"unpackedSize":10020,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGgyjG37I0+cFGsuOTUXPNQXBrq5XrGzdHOxQoys7ErEAiEA2VzhdEVkKgb/lSpeKwWyluMxUXT8V9PjRQ6q1tNF4XU="}]},"_npmUser":{"name":"tg666","email":"tomasglawaty@icloud.com"},"directories":{},"maintainers":[{"name":"tg666","email":"tomasglawaty@icloud.com"},{"name":"jelen07","email":"MoraviaD1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cookie-consent-resolver_1.0.0_1684291805594_0.1177529572730498"},"_hasShrinkwrap":false},"1.0.1":{"name":"@68publishers/cookie-consent-resolver","author":{"name":"68publishers"},"version":"1.0.1","description":"Inject scripts without waiting for the cookies widget to load!","private":false,"homepage":"http://www.68publishers.io/","main":"index.mjs","repository":{"type":"git","url":"git+https://github.com/68publishers/cookie-consent-resolver.git"},"keywords":["68publishers","consent","cookieconsent","cookie-consent","cookie-consent-resolver"],"scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","eslint:fix":"eslint ./index.mjs ./src ./__tests__ --ext .js,.mjs --fix","eslint":"eslint ./index.mjs ./src ./__tests__ --ext .js,.mjs","build":"webpack --config webpack.config.js"},"license":"MIT","dependencies":{},"devDependencies":{"@babel/core":"^7.21.8","@babel/polyfill":"^7.12.1","@babel/preset-env":"^7.21.5","babel-loader":"^9.1.2","eslint":"^8.40.0","eslint-plugin-jest":"^27.2.1","jest":"^29.5.0","jest-environment-jsdom":"^29.5.0","terser-webpack-plugin":"^5.3.8","webpack":"^5.82.1","webpack-cli":"^5.1.1"},"jest":{"testEnvironment":"jsdom","testMatch":["**/__tests__/**/*.test.mjs?(x)","**/?(*.)+(spec|test).mjs?(x)"],"moduleFileExtensions":["mjs","js"]},"gitHead":"ca4c3002c8c4716196d6b5676a68c9aa73195bbb","bugs":{"url":"https://github.com/68publishers/cookie-consent-resolver/issues"},"_id":"@68publishers/cookie-consent-resolver@1.0.1","_nodeVersion":"19.9.0","_npmVersion":"9.6.3","dist":{"integrity":"sha512-TC6HXq4GwILLBlLzJbyabOAi3WxbODbHZMqRW3cq/iemHx+98X1zGedW2Yd52gcfW715CKyx7pgEbTmoJBdUmw==","shasum":"5c4ba33acd8b0a9c5b829f57455026d3de4added","tarball":"https://registry.npmjs.org/@68publishers/cookie-consent-resolver/-/cookie-consent-resolver-1.0.1.tgz","fileCount":6,"unpackedSize":13540,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDuNfXnM0HW9/+HHYQnTzxbcjjJjh7IrYoG5nekivsKrAiEA+Ev8ggDVS7/+RC7WswCUq50iz/hcbtePA+tlj3m0Uww="}]},"_npmUser":{"name":"tg666","email":"tomasglawaty@icloud.com"},"directories":{},"maintainers":[{"name":"tg666","email":"tomasglawaty@icloud.com"},{"name":"jelen07","email":"MoraviaD1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cookie-consent-resolver_1.0.1_1684294323852_0.3234589787720057"},"_hasShrinkwrap":false}},"time":{"created":"2023-05-17T02:50:05.494Z","1.0.0":"2023-05-17T02:50:05.778Z","modified":"2023-05-17T03:32:04.270Z","1.0.1":"2023-05-17T03:32:04.133Z"},"maintainers":[{"name":"tg666","email":"tomasglawaty@icloud.com"},{"name":"jelen07","email":"MoraviaD1@gmail.com"}],"description":"Inject scripts without waiting for the cookies widget to load!","homepage":"http://www.68publishers.io/","keywords":["68publishers","consent","cookieconsent","cookie-consent","cookie-consent-resolver"],"repository":{"type":"git","url":"git+https://github.com/68publishers/cookie-consent-resolver.git"},"author":{"name":"68publishers"},"bugs":{"url":"https://github.com/68publishers/cookie-consent-resolver/issues"},"license":"MIT","readme":"<h1 align=\"center\">:cookie: Cookie Consent Resolver</h1>\n\n<p align=\"center\">Utility for <a href=\"https://github.com/68publishers/cookie-consent\">68publishers/cookie-consent</a> that allows you to inject scripts without waiting for the cookies widget to load!</p>\n\n<p align=\"center\">\n<img src=\"https://github.com/68publishers/cookie-consent-resolver/actions/workflows/tests.yml/badge.svg?branch=main\" alt=\"Tests\">\n<img src=\"https://github.com/68publishers/cookie-consent-resolver/actions/workflows/coding-style.yml/badge.svg?branch=main\" alt=\"Coding style\">\n</p>\n\n## Why\n\nIn some cases, it is desirable to run some scripts as soon as possible, and initializing the cookie widget may slow down the execution of these scripts.\nThis package allows scripts to be injected into the page immediately if the user has already given consent.\n\n## Installation\n\nThe first option is to download the package as a module.\n\n```sh\n$ npm i --save @68publishers/cookie-consent-resolver\n# or\n$ yarn add @68publishers/cookie-consent-resolver\n```\n\nAnd import it in your project.\n\n```js\nimport CookieConsentResolver from '@68publishers/cookie-consent-resolver';\n// or\nconst CookieConsentResolver = require('@68publishers/cookie-consent-resolver');\n```\n\nOr you can import the `CookieConsentResolver` into the browser from the CDN\n\n```html\n<script src=\"https://unpkg.com/@68publishers/cookie-consent-resolver/dist/cookie-consent-resolver.min.js\"></script>\n```\n\n## Usage\n\n```javascript\nvar cookieConsentResolver = CookieConsentResolver.createFromCookie('cc-settings');\n\ncookieConsentResolver.bindCookieConsentWrapper(CookieConsentWrapper);\n\n// the following script will be injected if the `ad_storage` is enabled\ncookieConsentResolver.injectScript('ad_storage', 'https://www.example.com/my-script.js');\n\n// the following script will be injected if the `ad_storage` and `analytics_storage` are enabled\ncookieConsentResolver.injectScript(['ad_storage', 'analytics_storage'], 'https://www.example.com/my-script2.js');\n```\n\nAdditional `<script>` tag attributes can be provided in the third argument.\n\n```javascript\ncookieConsentResolver.injectScript('ad_storage', 'https://www.example.com/my-script.js', {\n  id: 'my-script',\n  async: true,\n});\n```\n\nIf you want to do anything other than inject the script in case of consent, you can use the `resolve()` method.\n\n```javascript\ncookieConsentResolver.resolve('ad_storage', () => {\n  console.log('Ad storage is enabled!');\n});\n```\n\n## License\n\nThe package is distributed under the MIT License. See [LICENSE](LICENSE.md) for more information.\n","readmeFilename":"README.md"}