JSPM

fs-tree-structure

0.0.5
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 35714
    • Score
      100M100P100Q146320F
    • License MIT

    Build filesystem tree structure from flat paths

    Package Exports

    • fs-tree-structure

    Readme

    fs-tree-structure builds a filesystem tree structure from a list of flat paths.

    const filePaths = ["lib/feature/index.js", "lib/feature/util/index.js"];
    
    const treeStructure = makeTreeStructure(filePaths);
    
    assert.deepEqual(treeStructure, {
      lib: {
        feature: {
          "index.js": {},
          util: {
            "index.js": {}
          }
        }
      }
    });