Why I wrote a shitty npm package and why few people still use it

By Kshitij Awadhiya

When I started writing code for the first time, PHP was the goto language.

Want to setup a blog? PHP
E-Commerce website? PHP
Build an MVP for your startup? PHP
Scripting? PHP
Scraping a Website? PHP

Worst of all, it was vanilla PHP, not even a framework. Every component was handwritten. Not that it should be done that way nor is it the right way but writing your own tools made sure you knew what was happening behind those small libraries. To run migrations on MySQL, I used to maintain a list of PHP files in a `db` folder to create tables in MySQL. It wasn't really an automated solution. Once the code is deployed, one needs to log on to the server and run certain numbered files and get that done. The point of telling all this is that running it manually was a simple solution to a simple problem. It didn't account for scalability, continuous deployment etc but it worked.

This went on for a while until I switched to Python Django. The latest version was 1.4 that time for Django. Django didn't have a flexible migration system either. If you want to make changes to a table, you need to delete it manually using MySQL console and run migrations again. Django South solved that problem and eventually the library was packaged as a default with the core itself. This happened version 1.7 onward and before that, I had again switched to a different technology stack.

I worked on a year or two on NodeJS. The setup already existed when I started working. I didn't care about how the migrations were being executed but always assumed it was some npm module. I assumed that just like PHP, some simple package was being used to execute such puny tasks. I still don't know what it was. But after this, I worked for almost 3 year on RoR and Rails migrations amazed me. It is so smooth and transactional in nature. Although it doesn't work for tables with huge amounts of data but conceptually it worked fine.

After all this, I had to work on a small project on NodeJS and I was baffled to find no simple solution to run sequential migrations. I had to make 3 tables and needed to run 6-7 migrations but I couldn't find a npm package. I had to literally maintain a list in notes to run the migrations on production. That is when I came up with a shitty npm package to run migrations. This is all it does:
Generates a migration file using timestamp
Lets you write forward and backwards migrations
Lets you run migrations (all, particular or ranged)
That's it. Just to see how many people would use it, I made a publishable version and published it. It got an astonishing 13 stars and 13 forks on github. I had expected literally zero. I didn't even publicize or anything (because I didn't gain anything by doing that). Now, I have got multiple PRs open to fix things and it gets downloaded on an average 200-300 times a week. This might come down to 30-40 times a day but hey, there are still few people who want to keep things simple and they find my solution useful. I really want to thank them for showing appreciation by them using the package. Despite being a year old (and no updates), it hasn't been replaced by a better solution. Simple solutions are still being appreciated and I am thankful to the world for that.

In case you are wondering, that shitty npm package is mysql-migrations. Feel free to fork, apply for authorship or raise a PR :).

codeoldschool.blogspot.com/2019/03/why-i-wrote-shitty-npm-package-and-why.html

Attached: photo.jpg (120x120, 3.93K)

Other urls found in this thread:

theregister.co.uk/2016/03/23/npm_left_pad_chaos/
twitter.com/SFWRedditImages

Attached: dokuro.gif (351x398, 113.05K)

Pajeet

Can you do better than him?

no :(
I have a Rust library with 0 stars :(((

A higher number of people use webshit projects because the realm of modern web development (and non-web developers who have their origins from web development) is to duct tape together 700 different piles of shit into a horrible bloated abomination without writing a single line of original code.

Attached: c4rbhpap.png (524x398, 170.24K)

That schoolgirl's boobs are big so I wanna fuck her.

ikr?

You are dense.

Attached: pipiru.webm (640x480, 776.58K)

Right because it's soo bad to collaborate and share code.

Go ahead and reinvent the wheel 20 times as you complain about npm

Based.

theregister.co.uk/2016/03/23/npm_left_pad_chaos/

Attached: Screenshot_2019-03-25 trim.png (1212x717, 45.7K)

knex.js? That's what I use

HAPAS ARE SUPERIOR TO WHITES

HAPAS ARE SUPERIOR TO WHITES

HAPAS ARE SUPERIOR TO WHITES

HAPAS ARE SUPERIOR TO WHITES

HAPAS ARE SUPERIOR TO WHITES

HAPAS ARE SUPERIOR TO WHITES

HAPAS ARE SUPERIOR TO WHITES

Judensheim pls go

I smell rats.

Lots of shills in this thread.

Lots of shills in this thread.

Indeed.