Skip to content

Commit

Permalink
Better QR code explain
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcardeenas committed Apr 4, 2020
1 parent bf01427 commit 42525e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,19 @@ By default QR code will appear on the terminal. If you need to pass the QR somew
```javascript
const fs = require('fs');

// Second create() is the QR callback
sulla.create('session-marketing', (qrCode) => {
exportQR(qrCode, 'marketing-qr.png');
});

// Writes QR in specified path
function exportQR(qrCode, path) {
qrCode = qrCode.replace('data:image/png;base64,', '');
const imageBuffer = Buffer.from(qrCode, 'base64');

// Creates 'marketing-qr.png' file
fs.writeFileSync(path, imageBuffer);
}

sulla.create('session-marketing', (qrCode) => {
exportQR(qrCode, 'marketing-qr.png');
});
```

## Basic functions (usage)
Expand Down
Binary file removed marketing-qr.png
Binary file not shown.

0 comments on commit 42525e9

Please sign in to comment.