'Ello! It has been a while since I published NPM packages, so it is a time to rewind!
This week I decided to push couple of tiny but robust modules for NodeJS projects which have been inspired by my current project.
npm i --save-dev lasagnia
I faced an issue while trying to ensure that some required files are constantly persist in my project. Clealry, there are tons of ways to ensure the integrity of a project, however why not to try and build an NPM module for that? :)
Lasagnia (I actually misspelled Lasagne => Italian dish with layers of pastry and meat + cheese and other goodness) allows to use configuration file which contains a list of required files and folders. Once you install Lasagnia, it is possible to run it before or during the test to ensure all files and folders described in configuration file are present.
npm i --save safeget-json
We all know the pain of getting a node from a very big nested JSON which may not even exist! And then face a terrible:
Undefined child exception. Ouch!
Sure, I could go ahead and pull that latest lodash library in my project, however another great solution inspired by StackOverflow answer pushed to create a lightweight, elegant solution.
Safeget is an ultra-small package with a single function which allows to unwrap JSON file and provide a default value in case node doesn't exist. With a mighty help of Anonymous function!
You can always contribute! :P