Skip to content

Latest commit

 

History

History
29 lines (27 loc) · 6.43 KB

README.md

File metadata and controls

29 lines (27 loc) · 6.43 KB

CodeFormatter

Have you ever been looking at someone's program and noticed how many annoying semicolons and brackets are in the way of their code? Well now you can move them all to the side, to keep them away from your beautiful code!

Features

  • Able to run on the web for use in the browser
  • Can format multiple files at a time
  • Can format all files in a directory
  • Can automatically clone and format a project
  • Can adjust the spacing levels

Usage

Web

To use the web version, you can either go to https://rubbaboy.me/codeformatter/ for a hosted version of this project, or you can just upload the index.html and format_logic.js files to your webserver.

CLI

The CLI of CodeFormatter is very easy to use, and has a few different options.
Singe File - node format file-to-format.js - This formats a single file or directory
Multiple Files - node format file-1.js file-2.js directory-name - This does the same as above, but with multiple of whatever you want
Formatting a Git repository - node format https://github.com/RubbaBoy/CodeFormatter true - This clones or updates the given Git repository and then formats it. The true is optional, and indicates weather or not it should try and commit & push the repo. Adjusting Extra Space - node format 5 file-to-format.js - A number can be put after format in any command, and adds an extra amount of space. This is by default 0

Showcase

Code before (Code found from here):

Code after:

Here is an example with an adjusted 25 extra spaces:

A real-life demo

This is a real demo of formatting a fork of the repository SimpleNet

(Here's a link because GitHub doesn't like long gifs)