https://github.com/uppercod/indentation
https://github.com/uppercod/indentation
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/uppercod/indentation
- Owner: UpperCod
- Created: 2021-05-08T03:57:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-16T04:38:38.000Z (about 5 years ago)
- Last Synced: 2025-03-17T05:38:48.402Z (over 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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']];
```