I created my first open source npm package: @devadri/create-sticker

August 12, 2024

A few days ago I created my first open source npm package. I was building a simple concept app that erases the background of images using AI (just keeping the main object/person) and thought it would be nice to make them have a sticker border effect. I found out that there were no libraries yet that solves this task. However, I found a Stack Overflow answer that had the code I needed. The code just worked the way I wanted but it was not easy to use it like ‘plug-and-play’. So I reorganized it, adapted it to TypeScript and publish it as a npm package to make it super simple to be used by anyone. Now you only have to install the package (npm install @devadri/create-sticker) and call the function: createSticker(img.src, { strokeWidth, strokeColor, padding, fillHoles }).

The package contains a simple demo web to try it out. You can change the output settings modifying the demo/index.html file. Here are some screenshots taken from it:

Demo screenshot 1

Demo screenshot 2

Demo screenshot 3

Demo screenshot 4

Demo screenshot 5

Demo screenshot 6

Demo screenshot 7

The package has the Unlicense License, so you could do whatever you want with its code 😎.

Thank you for reading and hope you find it useful.