# less-tree

> Get less import file tree

Latest version **0.0.2** (published 2015-12-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install less-tree
pnpm add less-tree
yarn add less-tree
bun add less-tree
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2015-12-22 |
| First published | 2015-12-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | LingyuCoder |
| Maintainers | skyinlayer |

## Links

- npm: https://www.npmjs.com/package/less-tree
- Repository: https://github.com/LingyuCoder/less-tree
- Homepage: https://github.com/LingyuCoder/less-tree#readme
- Issues: https://github.com/LingyuCoder/less-tree/issues
- npm.io page: https://npm.io/package/less-tree

## Dependencies (5)

- [vinyl](https://npm.io/package/vinyl.md) ^1.1.0
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [treeify](https://npm.io/package/treeify.md) ^1.0.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^0.26.3
- [parse-less-import](https://npm.io/package/parse-less-import.md) 0.0.1

## Recent versions

- 0.0.2 (latest) — 2015-12-22
- 0.0.1 — 2015-12-22

## README

# less-tree

[![Test coverage](https://img.shields.io/coveralls/LingyuCoder/less-tree.svg?style=flat-square)](https://coveralls.io/r/LingyuCoder/less-tree?branch=master)
[![Build Status](https://travis-ci.org/LingyuCoder/less-tree.png)](https://travis-ci.org/LingyuCoder/less-tree)
[![Dependency Status](https://david-dm.org/LingyuCoder/less-tree.svg)](https://david-dm.org/LingyuCoder/less-tree)
[![devDependency Status](https://david-dm.org/LingyuCoder/less-tree/dev-status.svg)](https://david-dm.org/LingyuCoder/less-tree#info=devDependencies)
[![NPM version](http://img.shields.io/npm/v/less-tree.svg?style=flat-square)](http://npmjs.org/package/less-tree)
[![node](https://img.shields.io/badge/node.js-%3E=_4.0-green.svg?style=flat-square)](http://nodejs.org/download/)
[![License](http://img.shields.io/npm/l/less-tree.svg?style=flat-square)](LICENSE)
[![npm download](https://img.shields.io/npm/dm/less-tree.svg?style=flat-square)](https://npmjs.org/package/less-tree)

Get less import vinyl file tree

## Installation

```bash
$ npm install --save less-tree
```

## Usage

### Create Tree

```javascript
const lessTree = require('less-tree');

// create less vinyl file tree
let root = lessTree('a.less');

root.children // => get tree children vinyl file object
```

### toTreeObject

```javascript
// get tree object
root.toTreeObject();
/*
{
  'b.less': {
    'd.less': {
      'sub/f.less': {}
    }
  },
  'c.less': {
    'd.less': {
      'sub/f.less': {}
    }
  },
  'sub/e.less': {}
}
*/
```

### toTreeString


```javascript
// get tree string
root.toTreeString();
/*
├─ b.less
│  └─ d.less
│     └─ sub/f.less
├─ c.less
│  └─ d.less
│     └─ sub/f.less
└─ sub/e.less
*/
```

## Todo

* tree walker
* ...

## Test

```bash
$ npm run test
$ npm run test-cov
$ npm run test-travis
```

## License

The MIT License (MIT)

Copyright (c) 2015 LingyuCoder

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---
_Source: https://npm.io/package/less-tree · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
