0.3.2 • Published 6 months ago

dir2tree v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Demo

Want to try !

Install npm

npm install dir2tree

Import

Common Js

const dir2tree=require("dir2tree")

Es Module

import dir2tree from dir2tree

Syntaxe

Initialise

const MyTree=dir2tree(ROOT,OPTIONS,CALLBACKS)
MyTree.write(Target,"generated_file.json")

Arguments

  • ROOT : The path to the root directory that we want handle. it's required
  • OPTIONS : An object containing various configuration options to control the behavior of the tree generation.it's optional , These options might include :
    • fileContent : (Boolean)
    • fileName : (Boolean)
    • fileExtension : (Boolean)
    • length : (Boolean)
    • size : (Boolean)
    • linesCount : (Boolean)
    • created : (Boolean)
    • lastModified : (Boolean)
    • skip :
      • folder : (String[])
      • file : (String[])
      • extension : (String[])
    • sortBy : (String) , possible values : "names","extension","size","lines","created","lastmodified",
    • order : (Number)
  • CALLBACKS : it's optional

Methodes

  • .write(Target, filename)
  • .flat(depth, separator)

Use It in your Github Repository

Create a workflow file like the one below. .github/workflow/dir2tree.yml

name: Generate Directory Tree using zakarialaoui10/dir2tree
on:
  push: 
    branches:
      - main
jobs:
  build:
    permissions :
      contents : write
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}
      - name: Generate Directory Tree
        uses: zakarialaoui10/dir2tree@main
      - name: Commit & Push
        run: |
          git config user.name github-actions
          git config user.email github-actions@github.com
          git add -A .
          git commit -m "generated by zakarialaoui10/dir2tree"
          git push
        env:
          CUSTOM_TOKEN: ${{ secrets.CUSTOM_TOKEN }}

License

This projet is licensed under the terms of MIT License .

0.3.2

6 months ago

0.3.1

6 months ago

0.3.0

6 months ago

0.2.2

6 months ago

0.2.1

6 months ago

0.2.0

6 months ago

0.1.2

6 months ago

0.1.1

7 months ago

0.1.0

7 months ago