Posted in Interesting, Open Source, Programming, Web Tech

Pug.js

What is pug.js?

Pug.js a HTML template engine for Node.js. You can write a simple pug code which the compiler will compile it to HTML code and later on browser will render it.

How does pug code differ from html code?

Pug code is a crisp piece of code which looks like a paragraph which helps in readability. Pug supports JavaScript, so using JavaScript expressions, we can format HTML code. HTML code is consists of tags and Pug also uses same tags. But pug doesn’t have closing tags.

Some thoughts…

Since pug comes as a npm package we can run using browser or on node.js using cli. One should take care of white space while writing pug code, because it can cost a big time.

 

Posted in Softwares, Web Tech

Bower Power

What is Bower?

A web site is made of lots of things — frameworks, libraries, assets, and utilities. But keeping track of all these libraries and making sure they’re up-to-date can be tricky. Bower manages all these things for you. So, we can call bower to be a package manager for the web.

What bower can do?

Bower can manage components that contain HTML, CSS, JavaScript, fonts or even image files. Bower does not minify code or do anything else – it just installs the right versions of the packages you need and their dependencies.

Getting things done with bower

Installation : Bower is a command line utility, it can be installed easily using npm, the node package manager.

$ npm install -g bower

Searching packages :

$ bower search packagename 

Installing packages :

$ bower install packagename 

Listing packages :

$ bower list

Updating packages :

$ bower update packagename 

Uninstalling packages :

$ bower uninstall packagename 

We can save and install multiple packages using a single command by creating a bower.json file for your package with

$ bower init

Once we have got your bower.json file set up wecan simply execute the bower install command to install all of the packages we have specified in bower.json file.

And that’s the bower power!