# auto-indent

> Indenting strings made easy

Latest version **3.0.0** (published 2023-07-02) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install auto-indent
pnpm add auto-indent
yarn add auto-indent
bun add auto-indent
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2023-07-02 |
| First published | 2023-06-17 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | devitzer123 |
| Maintainers | devitzer123 |
| Keywords | indent, indenter, easy, indent, auto, indent |

## Links

- npm: https://www.npmjs.com/package/auto-indent
- npm.io page: https://npm.io/package/auto-indent

## Recent versions

- 3.0.0 (latest) — 2023-07-02
- 2.2.1 — 2023-06-19
- 2.2.0 — 2023-06-19
- 2.1.2 — 2023-06-19
- 2.1.1 — 2023-06-19
- 2.1.0 — 2023-06-19
- 2.0.1 — 2023-06-18
- 2.0.0 — 2023-06-18
- 1.0.1 — 2023-06-17
- 1.0.0 — 2023-06-17
- 1.0.0-prerelease — 2023-06-17

## README

# Auto Indent

<p>
    <img src="https://img.shields.io/npm/dw/auto-indent.svg" alt="Downloads/Week">
    <img src="https://img.shields.io/npm/v/auto-indent.svg" alt="Version"/>
    <img src="https://img.shields.io/maintenance/yes/2023.svg" alt="Maintenance"/>
    <img src="https://img.shields.io/badge/linter-eslint-red" alt="Linter">
    <img src ="https://img.shields.io/badge/made%20with%20%E2%99%A5%20by-devitzer123-red" alt="Developer">
</p>

Auto Indent is a simple but powerful and minimalist solution to indenting in the console.

# Contents

1. [Documentation](#documentation) <br>
  1.1 [Small Example](#small-example)
2. [Prerequisites](#prerequisites)
3. [Versioning Policy](#versioning-policy) <br>
  3.1 [Policy](#policy) <br>
    3.1.1 [Summary](#summary)
4. [Frequently Asked Questions](#frequently-asked-questions) <br>
  4.1 [Does this project support TypeScript?](#does-this-project-support-typescript) <br>
  4.2 [How can I find out about plans for new updates?](#how-can-i-find-out-about-plans-for-new-updates)
5. [Performance](#performance) <br>
  5.1 [Via console.time](#via-consoletime) <br>
  5.2 [Via jest](#via-jest)
6. [PLANS (spoil yourself if you'd like)](#plans-if-you-dont-want-to-spoil-it-for-yourself-dont-read-this)

# Documentation

All documentation can be found on [geodax.ca](https://geodax.ca), it's just the domain I have.

## Small Example

These are examples assuming you have configured auto-indent.

### CommonJS

```js
const indent = require("auto-indent");
const Settings = indent.loadSettings();

indent.stdout("Hello, World!", Settings); // Output: "  Hello, World!"
```

### ESM

```js
import indent from "auto-indent";
const Settings = indent.loadSettings();

indent.stdout("Hello, World!", Settings); // Output: "  Hello, World!"
```

# Prerequisites

Auto Indent requires atleast node v6.0.0.

# Versioning Policy

## Policy

Auto Indent uses Semantic Versioning here is an explanation from the official developers of SemVer:

### Summary

Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes
  2. MINOR version when you add functionality in a backward compatible manner
  3. PATCH version when you make backward compatible bug fixes

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

# Frequently Asked Questions

## Does this project support TypeScript?

**Technically.** <br>
The type declaration is generated by ChatGPT and put under a simple test, so I can't guarantee anything.

## How can I find out about plans for new updates?

**Scroll down to the bottom.** Do it! Just do it! Teehee! 🤓.

# Performance

## Via console.time

console.time method:
- stdout(2, "Hello, World!") in 5-8ms.
- ireturn(2, "Hello, World!") via console.log() was 6-9ms.
- loadSettings() via const Settings = loadSettings() was 0.5-1ms.

## Via jest

jest method:
- stdout(2, "Hello, World!") in 3ms.
- ireturn(2, "Hello, World!") in 3ms.
- loadSettings() in 4ms.

# PLANS (IF YOU DONT WANT TO SPOIL IT FOR YOURSELF DON'T READ THIS)

1. A way to fill in the indent with a symbol. Example: "♥♥Hello, World!"
2. Multiple lines indentation
3. Dedent function
4. Potentially bring CHANGELOG.md to [geodax.ca](https://geodax.ca)

---
_Source: https://npm.io/package/auto-indent · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
