Subscribe via RSS

How and why to use a Github branch as a dependency in your package.json

The combination of Open Source and GitHub is amazing. I can not count the times a freely accessible library or tool saved me countless hours or allowed me to built something I wasn’t otherwise capable of.

But sometimes you might not be happy with how a library/framework/tool/whatever handles something and you need a little change. Oftentimes for me that requirement is so specific to my project or problem that creating an issue makes no sense. Or maybe there is just no time to wait on a response and update.

Luckily you can fork a GitHub repository, change or fix it yourself and then pull the repo into your project right from there instead of pulling the npm package in. You can even point to a specific branch.

You can do this by either running the npm or yarn command on the CLI or by going the manual way editing the package.json

Command line

npm install --save-dev username/repo#branch-name
yarn add --dev username/repo#branch-name

Manual way

Open package.json, to to the "devDependencies" or "dependencies" key and add your package in the following format:

"package-name": "username/repo#branch-name",

And then install the package with npm install or yarn.

Don’t forget

If you already had the original version of the package in your project, make sure to remove it (and install your new package).

rm -rf ./node_modules/package-name && npm install
rm -rf ./node_modules/package-name && yarn

Or find the folder inside node_modules you want to replace and remove it and then npm install or yarn again.

If the change/update might be of interest for others too you can also create a Pull Request to the original package and see if your changes make it into the Repository and then you can maybe switch back to the original later.

This has the advantage that you will get further updates - which you won’t get in your own forked version. But Depending on your changes or needs that might also be a good thing. As always: It depends.

#shotoniphone

Blossom in backlighting

Original RAW, cropped to 2x3

Blossom in backlighting

Edited with VSCO

Coffee at The Visit Berlin

Sign reading

About a month ago Pascal was in Berlin and he showed me The Visit Berlin. The place is cool and the coffee delicious. If you get the chance, stop by.

A cup of coffee
Pascal looking at his iPhone

Pascal looking at his iPhone

A Restart

First, a little backstory. 😴

This website was once called TheAmazingWeb.net, a blog about all things web development. But after a while I decided to turn it more into my portfolio website with blog attached and switched the domain to to MartinWolf.org. I also had - or rather have - another blog, which is more or less only a photo blog by now (visuelleGedanken.de).

I’ve been running both blogs side by side for a while and then realized one or the other is always suffering, so I closed the martinwolf.org Blog and made this website just a simple portfolio site. I stopped writing about code and also only rarely posted photos to the other blog all while posting less and less to social media sites like Twitter or Instagram because it just doesn’t feel as good as it used to and I still get more and more concerned about what happens with my data.
Which brings us to today.

I like personal blogs and I like RSS. So I want to get back to that more. I also like code as well as photography. And I still like to publish personal journal-type things. So this website here shall be my new home where I hope and plan to post more regulary - also shorter status like posts. My life, code and photography will probably be the main topics, but basically it’ll be just what interests me. So be prepared for some gaming content as well. For now I’ll be posting in English 🇬🇧, but we will see if I can keep that up.

I’d be happy if you come along for the ride. Thank you for reading! ✌️

PS: Make sure to subscribe to the RSS feed if you want to follow along. Ah, and this site might be still a little bit rough around the edges or content might be missing. It’s as work in progress. 🔨