{"_id":"@dannymoerkerke/file-tree","_rev":"5-91e931dcd0c8412c0cf1d37ab0fe386f","name":"@dannymoerkerke/file-tree","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"@dannymoerkerke/file-tree","version":"0.0.1","description":"A file tree web component using the File System Access API","homepage":"https://dannymoerkerke.github.io/file-tree","repository":{"type":"git","url":"git+ssh://git@github.com/DannyMoerkerke/file-tree.git"},"main":"dist/file-tree.js","module":"dist/file-tree.es.js","unpkg":"dist/file-tree.umd.js","type":"module","publishConfig":{"access":"public"},"scripts":{"start":"ws -p 8100 --rewrite '/file-tree/(.*) -> /$1' --spa index.html","test":"ws -p 8888 --spa test/index.html","build":"rollup -c","prepare":"npm run build"},"author":{"name":"Danny Moerkerke","email":"danny@dannymoerkerke.nl"},"license":"ISC","dependencies":{"@dannymoerkerke/material-webcomponents":"^1.2.15"},"devDependencies":{"chai":"^4.3.4","local-web-server":"^5.1.1","mocha":"^9.1.1","rollup":"^2.56.3","rollup-plugin-babel-minify":"^10.0.0","sinon":"^11.1.2"},"gitHead":"5c44bee5911dcaffff4a328d2fef0a7a37caa03b","bugs":{"url":"https://github.com/DannyMoerkerke/file-tree/issues"},"_id":"@dannymoerkerke/file-tree@0.0.1","_nodeVersion":"15.4.0","_npmVersion":"7.0.15","dist":{"integrity":"sha512-cpJ94/uXVJnJEtnMq0STwnO15EKHb4R+z+3adEtxg5Vt2E74pp32BxSMis8FMZBDALUSZlnSoA0ctnXe4jOwsg==","shasum":"83a12cc834acc04ccb9f902d5576212cb0cd07c3","tarball":"https://registry.npmjs.org/@dannymoerkerke/file-tree/-/file-tree-0.0.1.tgz","fileCount":5,"unpackedSize":104444,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhREm5CRA9TVsSAnZWagAAPYkP/jnoIIRJGoFgw87LsV/h\nvap2QagJU60fgAdAr3WMT6ivEKkVgsYvMlQVuO7ZJJa8BGQFMTiUjEczgfjl\n+TUyNaLZZ03nuxmEhv5LIfNkSI6XpFklvgyODTjAaTzTqXv5IE3vuSSiv65X\nsQ19gWZu6mbfqQicXVHTy6/YJ1Dix6yHAu5t6Og5SCKefhAEOVppXg7ydELq\nlyn38v4NeV9H/PaYEKMn7WwY3EC4A+RSp++RiBp+7NAEbx6FBLdgMPYNKIEv\nSPK26d0jKty/HrLEHDqJSyF/QbQkKo1ZDvIKInRRUTaWi2umKX4t4TbPh8XQ\n8Q4E2QW4XhcFaCPl1/dn/hQsseNmsjOTvCGpkYXKROksQ/uaDHFIo7c9jn3p\nRl71sUFB8DwFa5X+h6jeevJIiur5uMz+vaIe33Qb9BVTItINDrN4ZMq+/4a9\nTvFYpNETAiR6hY56NWbJNQLsLvBe4dQUzv3lz/TORYAkBcxskbP3QERTbiLF\nQz4qxgVItJkCPJxl26pMrFlNWZ9uy9VVf0uex0DWWW6twLNkYjQ40kdYS3wW\n26Uz7P18hd3qFXDxrDddzVEku6Qmg6TVq5oX+YzE7s9r1/X3gMCHlWSnA8W1\nd2+2D7fn8Py+IiOh9aUq8FE1DHvWTL9tZJBLzcbkVRjj6Qe5w0qGD6gRhodu\nMtt1\r\n=Ir/N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBnB1NUUiU8SHVGcBSjMTul2MQOExdHwn6BSffomtfv5AiEAv7qD4ubexMofrz2qNvKP1tT2pd83IAR9xB+4976wytg="}]},"_npmUser":{"name":"dannymoerkerke","email":"danny@dannymoerkerke.nl"},"directories":{},"maintainers":[{"name":"dannymoerkerke","email":"danny@dannymoerkerke.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/file-tree_0.0.1_1631865273105_0.5034060499533091"},"_hasShrinkwrap":false},"0.0.2":{"name":"@dannymoerkerke/file-tree","version":"0.0.2","description":"A file tree web component using the File System Access API","homepage":"https://dannymoerkerke.github.io/file-tree","repository":{"type":"git","url":"git+ssh://git@github.com/DannyMoerkerke/file-tree.git"},"main":"dist/file-tree.js","module":"dist/file-tree.es.js","unpkg":"dist/file-tree.umd.js","type":"module","publishConfig":{"access":"public"},"scripts":{"start":"ws -p 8100 --rewrite '/file-tree/(.*) -> /$1' --spa index.html","test":"ws -p 8888 --spa test/index.html","build":"rollup -c","prepare":"npm run build"},"author":{"name":"Danny Moerkerke","email":"danny@dannymoerkerke.nl"},"license":"ISC","dependencies":{"@dannymoerkerke/material-webcomponents":"^1.2.15"},"devDependencies":{"chai":"^4.3.4","local-web-server":"^5.1.1","mocha":"^9.1.1","rollup":"^2.56.3","rollup-plugin-babel-minify":"^10.0.0","sinon":"^11.1.2"},"gitHead":"136f8b606df60304be9dbdc9bed565eac8623153","bugs":{"url":"https://github.com/DannyMoerkerke/file-tree/issues"},"_id":"@dannymoerkerke/file-tree@0.0.2","_nodeVersion":"15.4.0","_npmVersion":"7.0.15","dist":{"integrity":"sha512-jPiCHyaDmy1wBuMsky1wyj4UtWpEAp1EAthDirw1lG9TV5sZV6ZIuHpcO5zijxPKEf+/GVVOPj2H3Hx2QWJ3lA==","shasum":"4f280ad2d57780d95e0ac7b28b522a9ddaf27119","tarball":"https://registry.npmjs.org/@dannymoerkerke/file-tree/-/file-tree-0.0.2.tgz","fileCount":5,"unpackedSize":109181,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH180+MvypVMQChqMlkkQFsnJG6BH3Q1S63x1jb8s4bnAiAM/e6gmpVFak+Zk0bgczGFhlbQS8CqNPlndZS3Wf+H4A=="}]},"_npmUser":{"name":"dannymoerkerke","email":"danny@dannymoerkerke.nl"},"directories":{},"maintainers":[{"name":"dannymoerkerke","email":"danny@dannymoerkerke.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/file-tree_0.0.2_1634111614660_0.5750361715607872"},"_hasShrinkwrap":false},"0.0.3":{"name":"@dannymoerkerke/file-tree","version":"0.0.3","description":"A file tree web component using the File System Access API","homepage":"https://dannymoerkerke.github.io/file-tree","repository":{"type":"git","url":"git+ssh://git@github.com/DannyMoerkerke/file-tree.git"},"main":"dist/file-tree.js","module":"dist/file-tree.es.js","unpkg":"dist/file-tree.umd.js","type":"module","publishConfig":{"access":"public"},"scripts":{"start":"ws -p 8100 --rewrite '/file-tree/(.*) -> /$1' --spa index.html","test":"ws -p 8888 --spa test/index.html","build":"rollup -c","prepare":"npm run build"},"author":{"name":"Danny Moerkerke","email":"danny@dannymoerkerke.nl"},"license":"ISC","dependencies":{"@dannymoerkerke/material-webcomponents":"^1.2.15"},"devDependencies":{"chai":"^4.3.4","local-web-server":"^5.1.1","mocha":"^9.1.1","rollup":"^2.56.3","rollup-plugin-babel-minify":"^10.0.0","sinon":"^11.1.2"},"gitHead":"7ba20efe95f13909cd1e621fa8e732485a3cddd1","bugs":{"url":"https://github.com/DannyMoerkerke/file-tree/issues"},"_id":"@dannymoerkerke/file-tree@0.0.3","_nodeVersion":"15.4.0","_npmVersion":"7.0.15","dist":{"integrity":"sha512-4jYd6OvHTXHjl+/woXSHb5Ere5F0O3tIYTRE5sRfe2zJS2H77BpQKQWWaPlJiRHT83GTvDfn2vk5S6RTkeNiVQ==","shasum":"19ddb14e5d72a215a8a2d355da969d826dfbda6e","tarball":"https://registry.npmjs.org/@dannymoerkerke/file-tree/-/file-tree-0.0.3.tgz","fileCount":5,"unpackedSize":111284,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBN1Er4jS1hPF7pt93+Embm7nAT8Q80Qis/kyQ+A8AE7AiAa+anJnW6e1a7xMXRzkpd8WXS4ZoJ2bz6mRcc+SPdFqA=="}]},"_npmUser":{"name":"dannymoerkerke","email":"danny@dannymoerkerke.nl"},"directories":{},"maintainers":[{"name":"dannymoerkerke","email":"danny@dannymoerkerke.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/file-tree_0.0.3_1634114312980_0.1944868463138414"},"_hasShrinkwrap":false},"0.0.5":{"name":"@dannymoerkerke/file-tree","version":"0.0.5","description":"A file tree web component using the File System Access API","homepage":"https://dannymoerkerke.github.io/file-tree","repository":{"type":"git","url":"git+ssh://git@github.com/DannyMoerkerke/file-tree.git"},"main":"dist/file-tree.js","module":"dist/file-tree.es.js","unpkg":"dist/file-tree.umd.js","type":"module","publishConfig":{"access":"public"},"scripts":{"start":"ws -p 8100 --rewrite '/file-tree/(.*) -> /$1' --spa index.html","test":"ws -p 8888 --spa test/index.html","build":"rollup -c","prepare":"npm run build"},"author":{"name":"Danny Moerkerke","email":"danny@dannymoerkerke.nl"},"license":"ISC","dependencies":{"@dannymoerkerke/material-webcomponents":"^1.2.15"},"devDependencies":{"chai":"^4.3.4","local-web-server":"^5.1.1","mocha":"^9.1.1","rollup":"^2.56.3","rollup-plugin-babel-minify":"^10.0.0","sinon":"^11.1.2"},"gitHead":"43b7588ec50895273b70b7ac583cc8a8d815391a","bugs":{"url":"https://github.com/DannyMoerkerke/file-tree/issues"},"_id":"@dannymoerkerke/file-tree@0.0.5","_nodeVersion":"15.4.0","_npmVersion":"7.0.15","dist":{"integrity":"sha512-sY3A09A6yv3EGd4xqGj0uXVtBnNqirkg0U4Rx6sFrmAss0zBT73TUvRk44juKLfP/9qs4mLg6r/PfULM9EhjJA==","shasum":"1b0ede9aeda2fea4223ceef91a6eea13e9e38188","tarball":"https://registry.npmjs.org/@dannymoerkerke/file-tree/-/file-tree-0.0.5.tgz","fileCount":5,"unpackedSize":114458,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhyItTCRA9TVsSAnZWagAAnckP/0CmH6jUNJSxAZ4Mi+eW\n6Urvs+j6qJO7TXyhOajez/cR5gPkTGr9iH6A5W/XJ9XlJqbH5pSn+1nqcBPO\nMycOG7UbOxMCBS6eVPZW3IFRNz3syItkXxOVBP2FbrsxVoF0f2ejS6734F7q\ngp9Qv2UNSBa53iSYS6EyK1LI1tFrRgKk5QTZVVPpeedi2XWpigs+HYhN6U0C\nN8ZYR+raBCbERd8Jd7vC3WARRcYwYPQ7x3WIncBNqxVeN7kUlh3GzJXgeK0B\n8LiNLFcW7ApB6Wr7ydapomcuBvNUi631x8uXmA3Xxcpela6h4k3/BlsTSSEc\nIt/5D/2JWnFcP2gjy4Yj+rRiogUy0Yf3EN5iA5x30gnn9x6wy7OOUvGFR4zK\nsjwvPw9acWafMk6P9smMWxaeYSde8HYG80vwBCJYaCS9VE+4RDAIXrJTt/xX\n6LBvsoJYGvFhStiDiQ1hrwAMMh/0Y9KSd6pHBDu+zp90VYmkt/8Hq+T8eBh9\nNjly9Mjg6FYcNk3rkM+Wg4OqHJmIo2KgiL+KztudQk5hA+As5iDfHnukuGYL\nDyYoUy0YAjr2F+bINdIGkc4CrvmMALJwQRdzJ51r2lie2FcfRJKLH3mH+J1a\nWLMu3LaO/6cMqsrW9UycmopQMxv+OuB67Zy3vwODLv8/br8SBHXdl5ubYkvF\nMQqb\r\n=LEtH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDc3Hye93+KdI+8MsBjqW8UQnSi3ThwzSI5i3ipKLtybAIhAI627t9SW1RHhbDeNjYxIyVv/uWcoBAdQk4+bA8c4FI6"}]},"_npmUser":{"name":"dannymoerkerke","email":"danny@dannymoerkerke.nl"},"directories":{},"maintainers":[{"name":"dannymoerkerke","email":"danny@dannymoerkerke.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/file-tree_0.0.5_1634131892833_0.9727673912983996"},"_hasShrinkwrap":false}},"time":{"created":"2021-09-17T07:54:33.060Z","0.0.1":"2021-09-17T07:54:33.242Z","modified":"2022-04-05T02:42:24.809Z","0.0.2":"2021-10-13T07:53:34.866Z","0.0.3":"2021-10-13T08:38:33.113Z","0.0.5":"2021-10-13T13:31:33.012Z"},"maintainers":[{"name":"dannymoerkerke","email":"danny@dannymoerkerke.nl"}],"description":"A file tree web component using the File System Access API","homepage":"https://dannymoerkerke.github.io/file-tree","repository":{"type":"git","url":"git+ssh://git@github.com/DannyMoerkerke/file-tree.git"},"author":{"name":"Danny Moerkerke","email":"danny@dannymoerkerke.nl"},"bugs":{"url":"https://github.com/DannyMoerkerke/file-tree/issues"},"license":"ISC","readme":"# file-tree\n`<file-tree>` is a Web Component which provides access to the file system of the user's device using the \n[File System Access API](https://wicg.github.io/file-system-access/) and displays it as a file tree.\n\nIt is currently supported on desktop only in Chrome 86+ and Edge 86+.\n\n### Getting started\nTo install file-tree run:\n\n```\nnpm install @dannymoerkerke/file-tree\n```\n\nThen simply `import` it in your script:\n\n```\nimport './node_modules/@dannymoerkerke/file-tree/src/file-tree.js';\n```\n\nOr include it with a script tag as an ES6 module:\n\n```\n<script src=\"node_modules/@dannymoerkerke/file-tree/src/file-tree.js\" type=\"module\"></script>\n```\n\nAdd the HTML tag:\n\n```\n<file-tree></file-tree>\n```\n\n...and you're in business!\n\nInclude a button inside `<file-tree>` which will open the native browser dialog to open a directory. To do this, add the\n`slot=\"browse-button\"` attribute to this button:\n\n```html\n<file-tree>\n  <button type=\"button\" slot=\"browse-button\">Open directory</button>\n</file-tree>\n```\n\nThe browser dialog can also be opened programmatically:\n```javascript\nconst fileTree = document.querySelector('file-tree');\n\nfileTree.openDirectory();\n```\n\nAfter a directory is chosen, the browser will open two dialogs to ask for permission to open and save changes to files in\nthe chosen directory.\n\nAfter that, the contents of the directory will be displayed.\n\nWhenever a file inside the directory is clicked, a `file-selected` event will be thrown with the following data in its\n`detail` property:\n\n* `file`:\n * `name`: String, file name\n * `type`: String, MIME type\n * `contents`: String, textual content of the file or base-64 encoded in case of an image.\n* `path`: String, the path to the file\n* `handle`: FileSytemFileHandle, the native file handle object\n\nTo save the file back to disk:\n\n```javascript\nfileTree.saveFile(contents, handle = currentFileHandle)\n```\n\nwhere `contents` is the content of the file and `handle` defaults to the handle of the  currently opened file.\n\nTo save the file under another name:\n\n```javascript\nfileTree.saveFileAs(contents)\n```\n\nwhich will open the native browser dialog to select another file or enter a name.\n\n### Demo\nCheck the demo on [https://dannymoerkerke.github.io/file-tree/](https://dannymoerkerke.github.io/file-tree/)\n\nTo run the demo locally, run `npm install` once and then `npm start` and view the demo on\n[http://localhost:8080/file-tree](http://localhost:8080/file-tree)\n\n### Testing\nRun `npm test` and view the results on [http://localhost:8888/](http://localhost:8888/)\n\nThis repo also contains the configuration file `wallaby.cjs` to run the\ntests from your IDE using [Wallaby.js](https://wallabyjs.com/)\n\n### API\n\n***Properties***\n\n`ignoredDirectories`: string[], directories that will not be indexed for searching, defaults to `['.git', 'dist', 'node_modules']`\n\n`filesToIndex`: string[], file extensions that will be indexed for searching in files, defaults to `['txt', 'js', 'ts', 'css', 'html', 'json']`\n\n***Methods***\n\n`openDirectory(): void`, displays the native browser dialog to open a directory\n\n`saveFile(contents: string, handle: FileSystemFileHandle): {file: {name: string, contents: string, type: string}, handle: FileSystemFileHandle}`, \nsaves the file content `contents` to disk as the file represented by `handle`. `handle` defaults to the file that was previously selected.\n\n`saveFileAs(contents: string): void`, displays the native browser dialog to save a file and saves the file to disk as the file that was selected\nin the dialog or the filename that was entered in this dialog\n\n`newFile({startIn: string | FileSystemDirectoryHandle}?): {file: {name: string, contents: string, type: string}, handle: FileSystemFileHandle}`, displays the native \nbrowser dialog to create a new file in the directory specified in the `startIn` argument (optional)\n\n`deleteEntry({handle: FileSystemDirectoryHandle | FileSystemFileHandle, parentHandle: FileSystemDirectoryHandle}): void`, deletes the file or \ndirectory represented by `handle`, `parentHandle` represents the directory the entry to be deleted is in\n\n`pasteEntry(dirHandle, source: {path: string, handle: FileSystemDirectoryHandle | FileSystemFileHandle, entries: {}}): void`, pastes the file\nor directory represented by `source` in the directory represented by `dirHandle`\n\n`renameEntry(oldName: string, newName: string): void`, renames the file or directory `oldName` to `newName`, both `oldName` and `newName` are\n fully qualified paths\n\n*Currently the native API does not provide a method to rename a file or directory. This means that the item to be renamed will \nhave be copied and then the item with the old name will be removed. This means that  renaming a directory with a lot of \nfiles and subfolders may take a very long time.*\n\n`duplicateEntry(oldName: string, newName: string): void`, duplicates the file or directory `oldName` to `newName`, both `oldName` and `newName` are\nfully qualified paths\n\n\n","readmeFilename":"readme.md"}