Code Monkey home page Code Monkey logo

helix-qr-code's Introduction

Helix QR Code utilities

A library for generating and decoding QR codes

Status

codecov CircleCI GitHub license GitHub issues LGTM Code Quality Grade: JavaScript Renovate enabled semantic-release

Installation

$ npm install @adobe/helix-qr-code

Usage

Decode a QR code from the raw image file data:

const fs = require('fs');
const qr = require('@adobe/helix-qr-code');

const bytes = fs.readFileSync('image_with_qr_code.jpg');
qr.decodeFromBuffer(bytes).then((decoded) => console.log(decoded));

Encode text as a QR code (raw PNG file data output):

const fs = require('fs');
const qr = require('@adobe/helix-qr-code');

qr.encodeToBuffer('text to be encoded').then((buf) => fs.writeFileSync('qr_code.png', buf)));

Encode text as a QR code (SVG output):

const qr = require('@adobe/helix-qr-code');

qr.encodeToSVG('text to be encoded').then((svg) => console.log(svg)));

Encode text as a QR code (Data URL output):

const qr = require('@adobe/helix-qr-code');

qr.encodeToDataURL('text to be encoded').then((dataURL) => console.log(dataURL)));

See the API documentation for more information.

Development

Build

$ npm install

Test

$ npm test

Lint

$ npm run lint

helix-qr-code's People

Contributors

dependabot[bot] avatar renovate-bot avatar renovate[bot] avatar semantic-release-bot avatar stefan-guggisberg avatar tripodsan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

helix-qr-code's Issues

Create qr code service action for azure blobs

In the gdocs2md implementation (and potentially the word2md), it might not possible to decode the inline images on time due to time and memory constraints. in such cases, a dedicated action should be invoked to augment the missing data:

  • takes an url and returns a json containing the qrCode of the image (or some error information if the code couldn't be extracted)
  • if the url is a helix azure blob url, it updates it's metadata with the result
  • if the metadata already contain the QR code, it should not be updated again (since the blob name is a content hash and should remain stable)

Example metadata:

$ curl -sD- "https://hlx.blob.core.windows.net/external/4a6a05133a88e864c859ac9757b411e46220572f?comp=metadata"
HTTP/1.1 200 OK
Content-Length: 0
Last-Modified: Tue, 12 May 2020 08:16:00 GMT
ETag: "0x8D7F64CB4B0CD86"
Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: e68637d5-701e-0067-7fff-284208000000
x-ms-version: 2014-02-14
x-ms-meta-name: {"qrCode":"https://www.youtube.com/watch?v=m7atGkba-Z8"}
Date: Wed, 13 May 2020 08:22:59 GMT

The format of the metadata is not specified by set blob metadata.
We choose to use a JSON string of a metadata object.

Something like:

POST http://adobeioruntime.net/helix/helix-services/qr-code?url=https://hlx.blob.core.windows.net/external/4a6a05133a88e864c859ac9757b411e46220572f

200 OK
content-type: application/json

{
  data: {"qrCode":"https://www.youtube.com/watch?v=m7atGkba-Z8"}
}

etc....

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


No npm token specified.

An npm token must be created and set in the NPM_TOKEN environment variable on your CI environment.

Please make sure to create an npm token and to set it in the NPM_TOKEN environment variable on your CI environment. The token must allow to publish to the registry https://registry.npmjs.org/.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

circleci
.circleci/config.yml
  • circleci/node 14
github-actions
.github/workflows/semantic-release.yaml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/semver-check.yaml
npm
package.json
  • jimp ^0.16.0
  • jsqr ^1.2.0
  • qrcode ^1.4.4
  • @adobe/eslint-config-helix 1.3.2
  • @semantic-release/changelog 6.0.1
  • @semantic-release/git 10.0.1
  • @semantic-release/npm 9.0.1
  • ajv 8.11.0
  • codecov 3.8.3
  • commitizen 4.2.5
  • cz-conventional-changelog 3.3.0
  • eslint 8.23.0
  • eslint-plugin-header 3.1.1
  • eslint-plugin-import 2.26.0
  • fs-extra 10.1.0
  • jsdoc-to-markdown 7.1.1
  • junit-report-builder 3.0.1
  • lint-staged 13.0.3
  • mocha 10.0.0
  • nyc 15.1.0
  • semantic-release 19.0.5

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

generate QR Code

Describe the solution you'd like
Support generating QR codes from text.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.