@hankei6km/remark-qrcode
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

remark-qrcode

remark plugin to convert URL etc. that contained in Image or Link node.

Usage

code:

import { unified } from 'unified'
import remarkParse from 'remark-parse'
import stringify from 'remark-stringify'
import { remarkQRCode } from '@hankei6km/remark-qrcode'

const f = async (markdown: string): Promise<string> => {
  return await unified()
    .use(remarkParse)
    .use(remarkQRCode)
    .use(stringify, {})
    .freeze()
    .process(markdown)
    .then(
      (file) => {
        return String(file)
      },
      (error) => {
        throw error
      }
    )
}

console.log(f('# title1\n\n![alt1](qrcode:test1)\ntext1')

yield

# title1

![alt1](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHQAA ...snip ...=)
text1

License

MIT License

Copyright (c) 2021 hankei6km

The word "QR Code" is registered trademark of: DENSO WAVE INCORPORATED

Package Sidebar

Install

npm i @hankei6km/remark-qrcode

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

167 kB

Total Files

8

Last publish

Collaborators

  • hankei6km