Tag: linux

Showing 3 posts.

Creating command line tools with Node.js

March 15th, 2016    by sigman    1450
  Tips   nodejs, javascript, linux, programming

I needed to create an utility that when installed as a global module, it would be both available as a command line tool in bash and as a Node module that could be imported with require function from any Node script. As the command line tool, i wanted it to take input in two ways: take parameters and read input from a file or take piped streams. This tip explains how this can be achieved.

continue reading...

Regex basics

March 14th, 2012    by sigman    1693
  Primers   javascript, linux, RegEx

Regular expressions are patterns that can be matched against strings. They are used in many different situations and places. Most commonly regex come handy when doing operations on multiple files or working with strings like extracting specific values, validating forms, removing or replacing certain patterns like markup, splitting strings.

continue reading...