0.0.11 • Published 6 years ago

regularjs-beautify v0.0.11

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

regularjs-beautify

This is the missing code formatter of Regularjs.

Features

  • Includes a fresh parser rewriting in typescript
  • Follows the styles used in Prettier
  • Has few options

Usage

Use as lib

npm install regularjs-beautify

then

import { Formatter } from "regularjs-beautify"

Use as command-line

npx regularjs-beautify the-file-to-be-beautified

Above command just puts the results into stdin, plus an option -w if you want to effect the source file.

Contribute

It's easy to do step-in debugging of this repo in VSCode, here are some steps:

  • Touch a new file /src/local_test.ts
  • Put some code like below into that file:

    import { Formatter } from ".";
     
    // the code you want to test 
    const code = `
      <div>hello
    world`;
    
    // creates a formatter instance
    const formatter = new Formatter(code, "", 1, { printWidth: 80, baseIndent: 0 });
    
    // do formatting
    console.log(formatter.run());
  • Press F5 and switch to DEBUG CONSOLE to see the outputs

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago