Working with files in JavaScript (Node.js)

Node.js is the server side version of JavaScript. Since it is not limited by the web browser, we can access files on the file system. Here are several code snippets that demonstrate how to read, write, move, delete, change ownership, change permission, check if exists, and get statistics file size, timestamps, and ownership for files.

Input, Output, and Concatenation with Haskell

Standard in and Standard out (STDIN/STDOUT) are very common methods of interacting with the user. Standard in is typically the keyboard and standard out is the terminal. Haskell makes this very easy to access. The getLine function gets a value from the user and putStrLn and putStr allow you to write to output. The ++ operator is used to concatenate strings.

How to Write Command Line Tools

The shell is a powerful tool that I think most people underestimate and under-utilize. Bash is probably the most common in the community, so we will refer to bash in all the examples, but all shells should support the same concept of redirection and piping. Below are some things to keep in mind when writing a program that is intended to run on the command line and play well with the shell.