indent-outline
turns an indented outline document into a Javascript object
Last updated 5 years ago by benjamin_st .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install indent-outline 
SYNC missed versions from official npm registry.

#Indent Outline

If fileContents were the following

level1
	level2
	level2
		level3
		level3
	level2
		level3
level1

parse(fileContents) yields

[
   {
      "content":"level1",
      "inner":[
         {
            "content":"level2",
            "inner":[]
         },
         {
            "content":"level2",
            "inner":[
               {
                  "content":"level3",
                  "inner":[]
               },
               {
                  "content":"level3",
                  "inner":[]
               }
            ]
         },
         {
            "content":"level2",
            "inner":[
               {
                  "content":"level3",
                  "inner":[]
               }
            ]
         }
      ]
   },
   {
      "content":"level1",
      "inner":[]
   }
]

##How to Use

npm install 
var parser = require('indent-outline')
myObject = parser(fileContents)

Current Tags

  • 0.0.1                                ...           latest (5 years ago)

1 Versions

  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |