0.0.1 • Published 6 years ago

@ao-framework/writer v0.0.1

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

The writer is a library that was created to assist in developing multi-line strings for such things as code generation, documentation and error handling with custom templates.

Installation

npm install @ao-framework/writer

Import

import Writer from "@ao-framework/writer";

Usage

import Writer from "@ao-framework/writer";

let str = new Writer()
    .align("left")
    .indent(2)
    .line("I should be right against edge.")
    .line("So should I.", () => {
        writer.line("I should be indented 2 spaces", () => {
            writer.line("I should be indented 4 spaces")
        })
    }).getString()

console.log(str)

Outputs

I should be right against edge.
So should I.
  I should be indented 2 spaces
    I should be indented 4 spaces