Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
svelte-qrcode-image
Advanced tools
QR-Code generated using [qrcode](https://www.npmjs.com/package/qrcode) ([node-qrcode](https://github.com/soldair/node-qrcode)) and display via `` element, with TypeScript support, works on SvelteKit. Visit [this page](https://svelte-qrcode-i
QR-Code generated using qrcode (node-qrcode)
and display via <img>
element, with TypeScript support, works on SvelteKit.
Visit this page for live demo.
Under development, breaking change could occur before 1.0.0
Directly from npm:
npm install svelte-qrcode-image
From GitHub:
npm install git+https://github.com/1toldyou/svelte-qrcode-image.git
Under the <script>
tag:
import { QRCodeImage } from "svelte-qrcode-image";
for real example you can reference the source code of the demo page.
These parameters can be pass in to the <QRCodeImage />
Although none of them are required, but please fill in the text
prop | type | description | default value |
---|---|---|---|
text | string | what you want the QR Code to show; the QR Code will changed automatically if any changes in the variable binding to it | "Hello World" |
displayWidth | number | pass to the width property of <img> tag | null - the final <img> element will not have this property |
displayHeight | number | pass to the height property of <img> tag | null - the final <img> element will not have this property |
displayStyle | string | pass to the style property of <img> tag | "" - the final <img> element will not have this property |
displayStyle | string | pass to the style property of <img> tag | "" - the final <img> element will not have this property |
altText | string | pass to the alt property of <img> tag | "QR Code" |
margin | number | pass to margin to the options of qrcode: Define how much wide the quiet zone should be | 4 |
scale | number | pass to scale to the options of qrcode: A value of 1 means 1px per modules (black dots) | 4 |
width | number | pass to width to the options of qrcode: Forces a specific width for the output image and takes precedence over scale . | undefined - will be calculated |
errorCorrectionLevel | "L", "M", "Q", "H" | pass to errorCorrectionLevel to the options of qrcode: Error correction level. | "M" |
version | number | pass to version to the options of qrcode: QR Code version. | undefined - will be calculated |
If you encounter any problem, please open an issue on our GitHub Issue
Nevertheless, we recommend you to this with the latest version of Svelte or SvelteKit and unable to guarantee that it will work with older versions.
The minimum version required of SvelteKit is 1.0.0-next.373
which use Vite 3.
And only works with modern browsers by default.
<img>
tagOnce you've created a project and installed dependencies with npm install
(or pnpm install
or yarn
), start a development server:
npm run dev
You can change the port in vite.config.ts
.
Since this being setup as SvelteKit project, so you should create your component in src/lib
directory.
And re-export it in src/lib/index.js
file.
export { default as MyComponent } from './MyComponent.svelte';
Simply run this
svelte-package
will create a new directory called package
with the TypeScript definition
Then you can publish it to npm (remember to login first)
cd package
npm publish
or
npm publish ./package
Due to recent change in SvelteKit, you need to run this command to build the website
vite build
Instead of 'npm run build` Since it's calling in the background
svelte-kit sync && svelte-package
Which will npt create the public
directory, which is needed for the website to work.
I decided not to write the change log until 1.0.0, but the commit history should be enough to track the changes.
FAQs
QR-Code generated using [node-qrcode](https://github.com/soldair/node-qrcode) and display via `` or `<canvas>` element, with TypeScript support and exported as ESM, works on SvelteKit. Visit [this page](https://svelte-qrcode-image.itoldyou.dev/)
The npm package svelte-qrcode-image receives a total of 147 weekly downloads. As such, svelte-qrcode-image popularity was classified as not popular.
We found that svelte-qrcode-image demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.