1.0.0 • Published 7 years ago

dandeverefileclean v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

Strip Whitespace and (Optionally) // comments

Installation

Windows

  1. Install NodeJS

    • Check if Node is already installed in Powershell

      Node is Installed (skip to step 2):

      user$ node --version
      v6.11.2

      Node is not Installed (continue step 1):

      user$ node --version
      command not found
    • Go to https://nodejs.org/en/download/ and follow the instructions to install NodeJS

      When you are done run the command above again:

      user$ node --version
      v6.11.2

      Don't worry if the version number doesn't match. If it doesn't match and the program doesn't run see below for help.

  2. To use the tool run this command in powershell

    user$ node path\to\clean.js path\to\filetoclean.in (optional) no-comments

    This program will remove any whitespace and optionally single line (//) comments from a text file. I use the convention .in but it will accept a text file with a variety of extensions. The resulting file will be placed in the same directory as the source file and will have the extension .in.
    WARNING: THIS PROGRAM WILL OVERWRITE AN EXISTING .IN FILE WITH THE SAME NAME

macOS

  1. Install NodeJS

    • Check if Node is already installed in your Terminal

      Node is Installed (skip to step 2):

      user$ node --version
      v6.11.2

      Node is not Installed (continue step 1):

      user$ node --version
      command not found
    • Go to https://nodejs.org/en/download/ and follow the instructions to install NodeJS

      When you are done run the command above again:

      user$ node --version
      v6.11.2

      Don't worry if the version number doesn't match. If it doesn't match and the program doesn't run see below for help.

  2. To use the tool run this command in your Terminal

    user$ node path/to/clean.js path/to/filetoclean.in (optional) no-comments

    This program will remove any whitespace and optionally single line (//) comments from a text file. I use the convention .in but it will accept a text file with a variety of extensions. The resulting file will be placed in the same directory as the source file and will have the extension .in.
    WARNING: THIS PROGRAM WILL OVERWRITE AN EXISTING .IN FILE WITH THE SAME NAME

Linux

  1. Install NodeJS

    • Check if Node is already installed in your Terminal

      Node is Installed (skip to step 2):

      user$ nodejs --version
      v4.2.6

      Node is not Installed (continue step 1):

      user$ nodejs --version
      The program 'nodejs' is currently not installed. You can install it by typing: sudo apt install nodejs-legacy
    • Install NodeJS using apt-get.

      user$ sudo apt-get update
      ...
      user$ sudo apt-get install nodejs npm -y

      When you are done run the command above again:

      user$ nodejs --version
      v4.2.6

      Don't worry if the version number doesn't match. If it doesn't match and the program doesn't run see below for help.

  2. To use the tool run this command in your Terminal

    user$ nodejs path/to/clean.js path/to/filetoclean.in (optional) no-comments

    This program will remove any whitespace and optionally single line (//) comments from a text file. I use the convention .in but it will accept a text file with a variety of extensions. The resulting file will be placed in the same directory as the source file and will have the extension .in.
    WARNING: THIS PROGRAM WILL OVERWRITE AN EXISTING .IN FILE WITH THE SAME NAME

Wrong Version of Node and Program not working

Although unlikely this can happen. You will need to update NodeJS before you can run the program.

  • To Update your installation simply install node again by following the instructions above.
1.0.0

7 years ago