auto-indent
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

Auto Indent

Downloads/Week Version Maintenance Linter Developer

Auto Indent is a simple but powerful and minimalist solution to indenting in the console.

Contents

  1. Documentation
    1.1 Small Example
  2. Prerequisites
  3. Versioning Policy
    3.1 Policy
    3.1.1 Summary
  4. Frequently Asked Questions
    4.1 Does this project support TypeScript?
    4.2 How can I find out about plans for new updates?
  5. Performance
    5.1 Via console.time
    5.2 Via jest
  6. PLANS (spoil yourself if you'd like)

Documentation

All documentation can be found on geodax.ca, it's just the domain I have.

Small Example

These are examples assuming you have configured auto-indent.

CommonJS

const indent = require("auto-indent");
const Settings = indent.loadSettings();

indent.stdout("Hello, World!", Settings); // Output: "  Hello, World!"

ESM

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.
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

Package Sidebar

Install

npm i auto-indent

Weekly Downloads

6

Version

3.0.0

License

GPL-3.0

Unpacked Size

14.1 kB

Total Files

10

Last publish

Collaborators

  • devitzer123