{"_id":"@driesvanbilloen/qr-code-styling","_rev":"2-fb90fe703da0578c3d67e24afb1eb2fc","name":"@driesvanbilloen/qr-code-styling","dist-tags":{"latest":"1.5.3"},"versions":{"1.5.0":{"name":"@driesvanbilloen/qr-code-styling","version":"1.5.0","description":"Add a style and an image to your QR code","main":"lib/qrqoder.js","types":"lib/index.d.ts","dependencies":{"qrcode-generator":"^1.4.3"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","canvas":"^2.11.2","clean-webpack-plugin":"^3.0.0","eslint":"^7.17.0","eslint-config-prettier":"^7.1.0","eslint-loader":"^4.0.2","eslint-plugin-jest":"^24.1.3","eslint-plugin-prettier":"^3.3.1","html-webpack-plugin":"^4.5.1","jest":"^26.6.3","jest-environment-jsdom-fifteen":"^1.0.0","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-loader":"^8.0.14","typescript":"^4.1.3","webpack":"^5.12.3","webpack-cli":"^4.3.1","webpack-dev-server":"^3.11.1","webpack-merge":"^5.7.3"},"scripts":{"build":"webpack --mode=production --config webpack.config.build.js","build:dev":"webpack --mode=development --config webpack.config.build.js","test":"jest","start":"webpack serve --open --config webpack.config.dev-server.js"},"repository":{"type":"git","url":"git+https://github.com/kozakdenys/qr-code-styling.git"},"keywords":["qr","qrcode","qr-code","js","qrjs","qrstyling","styling","qrbranding","branding","qrimage","image","qrlogo","logo","design"],"author":{"name":"Denys Kozak","email":"kozak.denys.dev@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kozakdenys/qr-code-styling/issues"},"homepage":"https://qr-code-styling.com","gitHead":"391f289c6c773d1fc4f4898243bb25820654ea7b","_id":"@driesvanbilloen/qr-code-styling@1.5.0","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-atNsuU8NVXsQqI/Uej85UGR1otIcJv1h+ZjcBQUHQIGpmhHY8g3ijZnB5rxvL4YrXK9awq+9hwN8dLJIseH8Pg==","shasum":"3e30deac79a1636fa2d5256587e78ea661e0b1d3","tarball":"https://registry.npmjs.org/@driesvanbilloen/qr-code-styling/-/qr-code-styling-1.5.0.tgz","fileCount":3,"unpackedSize":12298,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAOgJanyxWHL0gQZlkxeFWhf3/z0VM9YvTIcGT6EC9EgIhALoPuTr+NbDjdox43SET1nE8Tq2DtsxvWu9sxbuh0mfY"}]},"_npmUser":{"name":"driesvanbilloen","email":"dries.vanbilloen@gmail.com"},"directories":{},"maintainers":[{"name":"driesvanbilloen","email":"dries.vanbilloen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/qr-code-styling_1.5.0_1686050377044_0.1883784859824853"},"_hasShrinkwrap":false},"1.5.2":{"name":"@driesvanbilloen/qr-code-styling","version":"1.5.2","description":"Add a style and an image to your QR code","main":"lib/qr-code-styling.js","types":"lib/index.d.ts","dependencies":{"qrcode-generator":"^1.4.3"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","canvas":"^2.11.2","clean-webpack-plugin":"^3.0.0","eslint":"^7.17.0","eslint-config-prettier":"^7.1.0","eslint-loader":"^4.0.2","eslint-plugin-jest":"^24.1.3","eslint-plugin-prettier":"^3.3.1","html-webpack-plugin":"^4.5.1","jest":"^26.6.3","jest-environment-jsdom-fifteen":"^1.0.0","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-loader":"^8.0.14","typescript":"^4.1.3","webpack":"^5.12.3","webpack-cli":"^4.3.1","webpack-dev-server":"^3.11.1","webpack-merge":"^5.7.3"},"scripts":{"build":"webpack --mode=production --config webpack.config.build.js","build:dev":"webpack --mode=development --config webpack.config.build.js","test":"jest","start":"webpack serve --open --config webpack.config.dev-server.js"},"repository":{"type":"git","url":"git+https://github.com/kozakdenys/qr-code-styling.git"},"keywords":["qr","qrcode","qr-code","js","qrjs","qrstyling","styling","qrbranding","branding","qrimage","image","qrlogo","logo","design"],"author":{"name":"Denys Kozak","email":"kozak.denys.dev@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kozakdenys/qr-code-styling/issues"},"homepage":"https://qr-code-styling.com","gitHead":"afed5789a4f48813bced5bafc148e9d84e9deab7","_id":"@driesvanbilloen/qr-code-styling@1.5.2","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-rXcqv5wXnxIH85Oz0afLoHou77Dez6at41ORUyBYB3EfejpWwFXUwuudMWnXbRUXKGWVNWkj7VeFSaZtJhTOdQ==","shasum":"7a5e279ea5889583321138d5f1a8f96772ab9d17","tarball":"https://registry.npmjs.org/@driesvanbilloen/qr-code-styling/-/qr-code-styling-1.5.2.tgz","fileCount":3,"unpackedSize":12306,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAFBM/ZyStSfW5VATyDg7mi2KOIqnVVj4BJWTG3h032VAiA8VGJa6qF2fTvZzdL09o2VdN3wXR+rc4S09Sd7OHRqjg=="}]},"_npmUser":{"name":"driesvanbilloen","email":"dries.vanbilloen@gmail.com"},"directories":{},"maintainers":[{"name":"driesvanbilloen","email":"dries.vanbilloen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/qr-code-styling_1.5.2_1686062883520_0.8931936375785756"},"_hasShrinkwrap":false},"1.5.3":{"name":"@driesvanbilloen/qr-code-styling","version":"1.5.3","description":"Add a style and an image to your QR code","main":"lib/qr-code-styling.js","types":"lib/index.d.ts","dependencies":{"qrcode-generator":"^1.4.3"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","canvas":"^2.11.2","clean-webpack-plugin":"^3.0.0","eslint":"^7.17.0","eslint-config-prettier":"^7.1.0","eslint-loader":"^4.0.2","eslint-plugin-jest":"^24.1.3","eslint-plugin-prettier":"^3.3.1","html-webpack-plugin":"^4.5.1","jest":"^26.6.3","jest-environment-jsdom-fifteen":"^1.0.0","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-loader":"^8.0.14","typescript":"^4.1.3","webpack":"^5.12.3","webpack-cli":"^4.3.1","webpack-dev-server":"^3.11.1","webpack-merge":"^5.7.3"},"scripts":{"build":"webpack --mode=production --config webpack.config.build.js","build:dev":"webpack --mode=development --config webpack.config.build.js","test":"jest","start":"webpack serve --open --config webpack.config.dev-server.js"},"repository":{"type":"git","url":"git+https://github.com/kozakdenys/qr-code-styling.git"},"keywords":["qr","qrcode","qr-code","js","qrjs","qrstyling","styling","qrbranding","branding","qrimage","image","qrlogo","logo","design"],"author":{"name":"Denys Kozak","email":"kozak.denys.dev@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kozakdenys/qr-code-styling/issues"},"homepage":"https://qr-code-styling.com","gitHead":"afed5789a4f48813bced5bafc148e9d84e9deab7","_id":"@driesvanbilloen/qr-code-styling@1.5.3","_nodeVersion":"16.20.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-r7vrgVOVTtHb63nG/nAGfqRUwpYghCBQp94RapGyC0opOoM9Gj9yyxLacYlHtntZEazi//udIIVr+NoL19EObQ==","shasum":"ff34e2a5bbdafa0919f9a255ca1b69a0a23c1a95","tarball":"https://registry.npmjs.org/@driesvanbilloen/qr-code-styling/-/qr-code-styling-1.5.3.tgz","fileCount":31,"unpackedSize":329096,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDg+UW5g3+IE8B29eoPOoUqWkjbFvH64pSB/WLZRDohDgIgK13P14QLSjZNM37ejcCnJK7zt7kNFuBR0vgYhwjcIVU="}]},"_npmUser":{"name":"driesvanbilloen","email":"dries.vanbilloen@gmail.com"},"directories":{},"maintainers":[{"name":"driesvanbilloen","email":"dries.vanbilloen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/qr-code-styling_1.5.3_1686063507545_0.6865379142091366"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-06T11:19:36.992Z","1.5.0":"2023-06-06T11:19:37.211Z","modified":"2023-06-06T14:58:27.865Z","1.5.2":"2023-06-06T14:48:03.727Z","1.5.3":"2023-06-06T14:58:27.768Z"},"maintainers":[{"name":"driesvanbilloen","email":"dries.vanbilloen@gmail.com"}],"description":"Add a style and an image to your QR code","homepage":"https://qr-code-styling.com","keywords":["qr","qrcode","qr-code","js","qrjs","qrstyling","styling","qrbranding","branding","qrimage","image","qrlogo","logo","design"],"repository":{"type":"git","url":"git+https://github.com/kozakdenys/qr-code-styling.git"},"author":{"name":"Denys Kozak","email":"kozak.denys.dev@gmail.com"},"bugs":{"url":"https://github.com/kozakdenys/qr-code-styling/issues"},"license":"MIT","readme":"# QR Code Styling\n[![Version](https://img.shields.io/npm/v/qr-code-styling.svg)](https://www.npmjs.org/package/qr-code-styling)\n\nJavaScript library for generating QR codes with a logo and styling.\n\nTry it here https://qr-code-styling.com\n\nIf you have issues / suggestions / notes / questions, please open an issue or contact me. Let's create a cool library together.\n### Examples\n<p float=\"left\">\n<img style=\"display:inline-block\" src=\"https://raw.githubusercontent.com/kozakdenys/qr-code-styling/master/src/assets/facebook_example_new.png\" width=\"240\" />\n<img style=\"display:inline-block\" src=\"https://raw.githubusercontent.com/kozakdenys/qr-code-styling/master/src/assets/qr_code_example.png\" width=\"240\" />\n<img style=\"display:inline-block\" src=\"https://raw.githubusercontent.com/kozakdenys/qr-code-styling/master/src/assets/telegram_example_new.png\" width=\"240\" />\n</p>\n\n### Installation\n\n```\nnpm install qr-code-styling\n```\n\n### Usage\n\n```HTML\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>QR Code Styling</title>\n    <script type=\"text/javascript\" src=\"https://unpkg.com/qr-code-styling@1.5.0/lib/qr-code-styling.js\"></script>\n</head>\n<body>\n<div id=\"canvas\"></div>\n<script type=\"text/javascript\">\n\n    const qrCode = new QRCodeStyling({\n        width: 300,\n        height: 300,\n        type: \"svg\",\n        data: \"https://www.facebook.com/\",\n        image: \"https://upload.wikimedia.org/wikipedia/commons/5/51/Facebook_f_logo_%282019%29.svg\",\n        dotsOptions: {\n            color: \"#4267b2\",\n            type: \"rounded\"\n        },\n        backgroundOptions: {\n            color: \"#e9ebee\",\n        },\n        imageOptions: {\n            crossOrigin: \"anonymous\",\n            margin: 20\n        }\n    });\n\n    qrCode.append(document.getElementById(\"canvas\"));\n    qrCode.download({ name: \"qr\", extension: \"svg\" });\n</script>\n</body>\n</html>\n```\n---\n\n[**React example (Codesandbox)**](https://codesandbox.io/s/qr-code-styling-react-example-l8rwl?file=/src/App.js)\n\n[**Angular example (Codesandbox)**](https://codesandbox.io/s/agitated-panini-tpgb2?file=/src/app/app.component.ts)\n\n---\n\n[**React example (source)**](https://github.com/kozakdenys/qr-code-styling-examples/tree/master/examples/react)\n\n[**Angular example (source)**](https://github.com/kozakdenys/qr-code-styling-examples/tree/master/examples/angular)\n\n[**Vue example (source)**](https://github.com/kozakdenys/qr-code-styling-examples/tree/master/examples/vue)\n\n---\n\n### API Documentation\n\n#### QRCodeStyling instance\n`new QRCodeStyling(options) => QRCodeStyling`\n\nParam  |Type  |Description\n-------|------|------------\noptions|object|Init object\n\n`options` structure\n\nProperty               |Type                     |Default Value|Description\n-----------------------|-------------------------|-------------|-----------------------------------------------------\nwidth                  |number                   |`300`        |Size of canvas\nheight                 |number                   |`300`        |Size of canvas\ntype                   |string (`'canvas' 'svg'`)|`canvas`     |The type of the element that will be rendered\ndata                   |string                   |             |The date will be encoded to the QR code\nimage                  |string                   |             |The image will be copied to the center of the QR code\nmargin                 |number                   |`0`          |Margin around canvas\nqrOptions              |object                   |             |Options will be passed to `qrcode-generator` lib\nimageOptions           |object                   |             |Specific image options, details see below\ndotsOptions            |object                   |             |Dots styling options\ncornersSquareOptions   |object                   |             |Square in the corners styling options\ncornersDotOptionsHelper|object                   |             |Dots in the corners styling options\nbackgroundOptions      |object                   |             |QR background styling options\n\n`options.qrOptions` structure\n\nProperty            |Type                                              |Default Value\n--------------------|--------------------------------------------------|-------------\ntypeNumber          |number (`0 - 40`)                                 |`0`\nmode                |string (`'Numeric' 'Alphanumeric' 'Byte' 'Kanji'`)|\nerrorCorrectionLevel|string (`'L' 'M' 'Q' 'H'`)                        |`'Q'`\n\n`options.imageOptions` structure\n\nProperty          |Type                                   |Default Value|Description\n------------------|---------------------------------------|-------------|------------------------------------------------------------------------------\nhideBackgroundDots|boolean                                |`true`       |Hide all dots covered by the image\nimageSize         |number                                 |`0.4`        |Coefficient of the image size. Not recommended to use ove 0.5. Lower is better\nmargin            |number                                 |`0`          |Margin of the image in px\ncrossOrigin       |string(`'anonymous' 'use-credentials'`)|             |Set \"anonymous\" if you want to download QR code from other origins.\n\n`options.dotsOptions` structure\n\nProperty|Type                                                                          |Default Value|Description\n--------|------------------------------------------------------------------------------|-------------|-------------------\ncolor   |string                                                                        |`'#000'`     |Color of QR dots\ngradient|object                                                                        |             |Gradient of QR dots\ntype    |string (`'rounded' 'dots' 'classy' 'classy-rounded' 'square' 'extra-rounded'`)|`'square'`   |Style of QR dots\n\n`options.backgroundOptions` structure\n\nProperty|Type  |Default Value\n--------|------|-------------\ncolor   |string|`'#fff'`\ngradient|object|\n\n`options.cornersSquareOptions` structure\n\nProperty|Type                                     |Default Value|Description\n--------|-----------------------------------------|-------------|-----------------\ncolor   |string                                   |             |Color of Corners Square\ngradient|object                                   |             |Gradient of Corners Square\ntype    |string (`'dot' 'square' 'extra-rounded'`)|             |Style of Corners Square\n\n`options.cornersDotOptions` structure\n\nProperty|Type                     |Default Value|Description\n--------|-------------------------|-------------|-----------------\ncolor   |string                   |             |Color of Corners Dot\ngradient|object                   |             |Gradient of Corners Dot\ntype    |string (`'dot' 'square'`)|             |Style of Corners Dot\n\nGradient structure\n\n`options.dotsOptions.gradient`\n\n`options.backgroundOptions.gradient`\n\n`options.cornersSquareOptions.gradient`\n\n`options.cornersDotOptions.gradient`\n\nProperty  |Type                        |Default Value|Description\n----------|----------------------------|-------------|---------------------------------------------------------\ntype      |string (`'linear' 'radial'`)|\"linear\"     |Type of gradient spread\nrotation  |number                      |0            |Rotation of gradient in radians (Math.PI === 180 degrees)\ncolorStops|array of objects            |             |Gradient colors. Example `[{ offset: 0, color: 'blue' }, {  offset: 1, color: 'red' }]`\n\nGradient colorStops structure\n\n`options.dotsOptions.gradient.colorStops[]`\n\n`options.backgroundOptions.gradient.colorStops[]`\n\n`options.cornersSquareOptions.gradient.colorStops[]`\n\n`options.cornersDotOptions.gradient.colorStops[]`\n\nProperty|Type            |Default Value|Description\n--------|----------------|-------------|-----------------------------------\noffset  |number (`0 - 1`)|             |Position of color in gradient range\ncolor   |string          |             |Color of stop in gradient range\n\n#### QRCodeStyling methods\n`QRCodeStyling.append(container) => void`\n\nParam    |Type       |Description\n---------|-----------|-----------\ncontainer|DOM element|This container will be used for appending of the QR code\n\n`QRCodeStyling.getRawData(extension) => Promise<Blob>`\n\nParam    |Type                                |Default Value|Description\n---------|------------------------------------|-------------|------------\nextension|string (`'png' 'jpeg' 'webp' 'svg'`)|`'png'`      |Blob type\n\n`QRCodeStyling.update(options) => void`\n\nParam  |Type  |Description\n-------|------|--------------------------------------\noptions|object|The same options as for initialization\n\n`QRCodeStyling.download(downloadOptions) => Promise<void>`\n\nParam          |Type  |Description\n---------------|------|------------\ndownloadOptions|object|Options with extension and name of file (not required)\n\n`downloadOptions` structure\n\nProperty |Type                                |Default Value|Description\n---------|------------------------------------|-------------|-----------------------------------------------------\nname     |string                              |`'qr'`       |Name of the downloaded file\nextension|string (`'png' 'jpeg' 'webp' 'svg'`)|`'png'`      |File extension\n\n\n### License\n\n[MIT License](https://raw.githubusercontent.com/kozakdenys/qr-code-styling/master/LICENSE). Copyright (c) 2021 Denys Kozak\n\n","readmeFilename":"README.md"}