An open API service indexing awesome lists of open source software.

https://github.com/uppercod/indentation


https://github.com/uppercod/indentation

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# @uppercod/indentation

allows to know the indentation per line associated with each line a depth factor, the calculation is indifferent to the use of tab or space so it is constant.

## install

```
npm install @uppercod/indentation
```

## Usage

```js
import { getIndentation } from "@uppercod/indentation";

const yaml = `
root
- every
`;

console.log(getIndetation(yaml)); // [[0,'root'],[1,'- every']];
```