0.0.3 • Published 1 year ago

hipt v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

2 years ago