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

0.0.3 • Public • Published

Hierarchically Indented Plain Text

This is a library to parse plain text with indentation like this:

abc
  def
    ghi
123
  456
    789

Installation

$ npm i hipt
$ yarn add hipt

Usage

import * as hipt from 'hipt';

const root = hipt.parse(
`abc
  def
    ghi
123
  456
    789`
);
/*
{
  "children": [
    {
      "value": "abc",
      "children": [
        {
          "value": "def",
          "children": [
            {
              "value": "ghi",
              "children": []
            }
          ]
        }
      ]
    },
    {
      "value": "123",
      "children": [
        {
          "value": "456",
          "children": [
            {
              "value": "789",
              "children": []
            }
          ]
        }
      ]
    }
  ]
}
*/

License

MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i hipt

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

15.9 kB

Total Files

9

Last publish

Collaborators

  • k0michi