Skip to main content

My first ever npm package

So lately I published my first npm package.
It gave me immense joy to share it with you here.

But it's not something I was planning to do. Things happen you know.
Quickly and unexpectedly.

I was working on a MEAN stack project for the last 2-3 months. When working on the backed of stuff, I was going on creating files and doing the same or somewhat same set of codes over and over again.

If it's something related to user, then the file name of the controller is user.controller.js and the service file name is user.service.js. With method, names are getUser, or getUsers, or deleteUser.

And if it's on some other stuff, say a device, most of the logic remains the same, except this time the name of the method and files changes to deleteDevice and device.controller.js etc.

You get the point.

So which means I am wasting a lot of time on somethings that I could automate, time which I could easily focus on optimizing the code and making it bug-free.

So I wanted to have two birds in one shot. And thus born my first npm package and my lazy file structuring habit (although it's quite nice and powerful).

The package can be obtained from, of course, npm.

Here's the link do try it out.

https://www.npmjs.com/package/lnfc

Now I know the name is quite vague. But hold on to me, I am in the process of making it better.

What the package does, once you install it globally is create a file/folder structure within your barebones projects, with only a few keystrokes, so that you can forget about your nitty bitty code and focus only on your code logic.

C'mon ask yourself how many hours do you waste in your life, writing that same set of code structure but only with a name change?


Comments

Popular posts from this blog

AI. Will it replace us or...?

AI!! The buzzword is too hot in the market nowadays. Do you have a technical product or an idea? If it doesn't have AI in it, then chances are it's not going to be sold like hot cakes. That is how things have changed lately. It is no wonder why me and my colleagues at Gelato want to see what AI can do in a niche department like customer support and service. And that is exactly what we did. For a company like Gelato, which is in the market for production-on-demand, there are a lot of customer questions you need to answer. It can be related to products, queries about shipping and pricing, and so on and so forth. Thus, our customer support team is always happy to help with these recurring questions. Let's take one example. A customer asked us, "Do you ship to Norway?" Now that is an easy question to answer if you have the knowledge written somewhere where you could refer to it and say, "Yes! As a matter of fact, we do." Following the same thread, the next q...

Replication and transactional guarantee in MongoDB

One of the projects I am working on is using MongoDB as the database solution. And the project makes use of the nifty ORM mongoose to do the heavy lifting of data orchestration. It was high time I implemented transactions to the equation but because of a time crunch I was not able to start with one and the situation merely demands it at times. But come with an architectural change and the way the project was heading it was high time I implemented transactions by using MongoDB. According to MongoDB documentation, transactions are used when the situation requires, “atomicity of reads and writes to multiple documents (in single or multiple collections)”. MongoDB supports multi-document transactions. With distributed transactions, transactions can be used across multiple operations, collections, databases, documents, and shards. Now the piece of code to implement the same was pretty straightforward. // For a replica set, include the replica set name and a seedlist of the members in the URI...

My experience with the Golden signals

In June 2022, I embarked on a quest for a new job opportunity. Fortunately, this endeavor began just before the global job market experienced a significant downturn. I must admit, I faced my fair share of rejections during this period, but I also had an epiphany. It became evident that there was so much more to learn and understand in the world of technology. Coming from a small service-based company, I had encountered limitations in terms of how much I could learn on the job. However, during interviews and conversations with senior developers, I gained valuable insights into the architectural and technical decisions made by teams in various companies. One such company that left a lasting impression on me was Delivery Hero. Their technical blog posts provided a wealth of information, especially for someone like me, transitioning from a smaller company where projects had minimal daily active users compared to the scale of Delivery Hero. One particular blog post that caught my attention ...