Skip to content

My qr-code generator library !

QRify is a qr code generator package i created and published to npm

KKilian1 min read
An abstract drawing made by stable diffusion AI
On this page
  1. Introduction
  2. Why ?
  3. Initialization
  4. Development
  5. Testing
  6. Publish
  7. Conclusion

Introduction

Hello and welcome back to Nebu ! In this article I will show you how I created and published my first package but first things first, why would I create a package ?

Why ?

Well, as you can see on the right side of your screen (on laptop) there is a qr-code. It is located on a lot of Nebu’s pages and links toooooo………. itself. Yup. It may seems dumb at first and it may be so. I had this idea while developing the articles and you can use it to open the page from a smartphone. The logos under the qr-code are links to directly share the page with facebook, reddit or twitter, hum, i mean X. Oh and clicking on the qr-code copy the url into the clipboard (I just haven’t coded a tooltip yet).

Initialization

Starting from scratch, create a new folder and initialize it with npm, if needed, initialize git.

mkdir qrify
cd qrify
npm login
npm init --scope=@kiliannnnn
git init

Development

This part will essentially develop the qr code generator script.

Testing

What I didn’t knew but is still an awesome feature is that you can test your package simply by installing it like you would with any published package thanks to the local path. It looks like this

npm install C:\Path\to\package

Publish

npm publish --access public
npm version patch
npm version minor

Conclusion

Keep reading

Esc