Socket
Socket
Sign inDemoInstall

@abmaonline/less-tree

Package Overview
Dependencies
22
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @abmaonline/less-tree

Get less import file tree


Version published
Maintainers
1
Install size
1.80 MB
Created

Changelog

Source

0.2.0

Breaking changes 💥

  • Needs Node.js >= 8 (since still pre 1.0, the minor versions count as major, this is also respected by npm)

Readme

Source

@abmaonline/less-tree

NPM version node License npm download

Get less import vinyl file tree

Originally created by LingyuCoder, but no longer available on github and made some changes to make it more robust.

Installation

$ npm install --save @abmaonline/less-tree

Usage

Create Tree

const lessTree = require('@abmaonline/less-tree');

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

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

toTreeObject

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

toTreeString

// 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

$ npm run test
$ npm run test-cov

FAQs

Last updated on 21 Jun 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc