Just use this string:
npm install git+ssh://git@github.com:qwertmax/qr-code-library.git
If you need a specific branch, you will add a branch name after #, e.g.:
npm install git+ssh://git@github.com:qwertmax/qr-code-library.git#feature/qr-code-rerenders
For example, if you develop React application (you can use it in other js-projects), you will apply it like this:
// QRCodeImage.js component
import React from 'react';
import qrcode from 'qr-code-library';
const QRCodeImage = () => {
const image = qrcode.createQrCodeForText('Hello world!');
return <img src={image} alt="QR code" />;
};
export default App;Each creator returns a base64 representation of a qr-code image.
createQrCodeForText(text[, options])
text - String - text to encode.
createQrCodeForUrl(url[, options])
url - String - url string to encode.
createQrCodeForEmail(dest[, options])
dest - Object - email object to encode.
dest.email-Stringdest.subject-Stringdest.body-Stringdest.cc-Stringdest.bcc-String
createQrCodeForSms(smsDest[, options])
smsDest - Object - sms object to encode.
dest.tel-Stringdest.message-String
createQrCodeForVCard(urlString[, options])
text - Object - vCard object to encode.
firstName-StringlastName-Stringorganization-Stringrole-Stringphone-Stringurl-Stringemail-Stringcountry-Stringstate-Stringcity-Stringstreet-Stringzip-String
Options is optional argument.
{
type: 'render content type';
content: {...},
finder: {...},
border: {...} // coming soon...
}- 'RECT_DOTS'
- 'ROUND_DOTS'
Content options provide color, margins, background color and image object (see Adding image).
options = {
content: {
color: 'white',
background: 'black',
margins: 20,
image: HTMLImageElement
},
...
}You can customize all finders and each separately both.
options = {
...
finders: {
type: 'render finder type',
innerColor: '#ddd',
outerColor: 'red',
finder1: {
type: 'render finder type',
innerColor: '#ddd',
outerColor: 'red'
},
finder2: {
type: 'render finder type',
innerColor: '#ddd',
outerColor: 'red'
},
finder3: {
type: 'render finder type',
innerColor: '#ddd',
outerColor: 'red'
}
}
}- 'RECT_DOTS'
- 'ROUND_DOTS'
- 'ROUND'
If you want to add an image, you will use one of these things: CSSImageValue, HTMLImageElement, SVGImageElement, HTMLVideoElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas. See more
