@hexlet/trees

0.7.1 • Public • Published

js-trees

github action status

Install

npm install @hexlet/trees

Usage example

import Tree from '@hexlet/trees';

const tree = new Tree('/', 'root directory');
tree.getMeta(); // 'root directory'
const etcNode = tree.addChild('etc');
etcNode.getKey(); // 'etc'

tree.hasChild('etc'); // true
etcNode.getParent() === tree; // true

etcNode.hasChildren(); // false
tree.hasChildren(); // true

const libNode = etcNode.addChild('lib');
libNode === tree.getChild('lib'); // true
libNode === tree.getDeepChild(['etc', 'lib']); // true

etcNode.removeChild('lib'); // true
etcNode.hasChild('lib'); // false

For more information, see the Full Documentation

Hexlet Ltd. logo

This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet (in Russian).

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.7.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.7.1
    0
  • 0.7.0
    0
  • 0.6.0
    0
  • 0.5.11
    0

Package Sidebar

Install

npm i @hexlet/trees

Weekly Downloads

0

Version

0.7.1

License

ISC

Unpacked Size

11.3 kB

Total Files

10

Last publish

Collaborators

  • dzencot
  • grozwalker
  • mshkv
  • mokevnin
  • corsicanec82