Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

glob-tree-list

bluelovers4.6kISC2.0.3TypeScript support: included

glob result list to tree

node-novel, dir, glob, tree, create-by-yarn-tool, create-by-tsdx

readme

glob-tree-list

glob result list to tree

demo

import { globToTree, treeToGlob } from 'glob-tree-list';

let data = `00020_1章.txt
00020_2章/
00020_3章/
00020_3章/3章 8話.txt
00020_3章/3章 9話/3章 9話file.txt
00020_3章/3章 10話.txt
00020_3章/3章 11話.txt
00020_3章/3章 12話.txt
00020_3章/3章 13話.txt
00020_3章/3章 14話.txt
00020_3章/3章 15話.txt
00020_3章/3章 15.5話 特別閑話.txt
00020_3章/3章 16話.txt
00020_3章/3章 17話.txt`.split("\n");

let t = globToTree(data);

console.log(t);

console.log(treeToGlob(t));
{ '00020_1章.txt': '00020_1章.txt',
  '00020_2章/': null,
  '00020_3章/': 
   { '3章 8話.txt': '3章 8話.txt',
     '3章 9話/': { '3章 9話file.txt': '3章 9話file.txt' },
     '3章 10話.txt': '3章 10話.txt',
     '3章 11話.txt': '3章 11話.txt',
     '3章 12話.txt': '3章 12話.txt',
     '3章 13話.txt': '3章 13話.txt',
     '3章 14話.txt': '3章 14話.txt',
     '3章 15話.txt': '3章 15話.txt',
     '3章 15.5話 特別閑話.txt': '3章 15.5話 特別閑話.txt',
     '3章 16話.txt': '3章 16話.txt',
     '3章 17話.txt': '3章 17話.txt' } }
[ '00020_1章.txt',
  '00020_2章/',
  '00020_3章/3章 8話.txt',
  '00020_3章/3章 9話/3章 9話file.txt',
  '00020_3章/3章 10話.txt',
  '00020_3章/3章 11話.txt',
  '00020_3章/3章 12話.txt',
  '00020_3章/3章 13話.txt',
  '00020_3章/3章 14話.txt',
  '00020_3章/3章 15話.txt',
  '00020_3章/3章 15.5話 特別閑話.txt',
  '00020_3章/3章 16話.txt',
  '00020_3章/3章 17話.txt' ]

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.0.3 (2024-02-03)

🔖 Miscellaneous

2.0.2 (2022-10-15)

🛠 Build System

2.0.1 (2022-10-01)

BREAKING CHANGES

  • update to tsdx

🐛 Bug Fixes

  • try avoid error during build (61cc482)
  • path.parse.dir not same as path.dirname (c59cbeb)
  • update types (68b21cc)

📦 Code Refactoring

📚 Documentation

🚨 Tests

  • try avoid error during test (d2f660d)

🛠 Build System

🔖 Miscellaneous

1.0.17 (2022-08-27)

📦 Code Refactoring

  • update configuration and import (86b99b5)

🚨 Tests

  • snapshot: update snapshot (068deae)

1.0.16 (2022-07-26)

Bug Fixes

1.0.15 (2022-07-26)

Bug Fixes

1.0.14 (2022-07-26)

Bug Fixes

1.0.13 (2021-07-08)

Note: Version bump only for package glob-tree-list

1.0.12 (2020-06-09)

Note: Version bump only for package glob-tree-list

1.0.11 (2020-06-08)

Note: Version bump only for package glob-tree-list

1.0.10 (2020-06-08)

Bug Fixes

1.0.9 (2020-06-08)

Bug Fixes

1.0.8 (2020-06-08)

Bug Fixes

  • bug when list is dir, will get empty (e47d064)

1.0.7 (2020-06-03)

Note: Version bump only for package glob-tree-list

1.0.6 (2020-06-03)

Note: Version bump only for package glob-tree-list