![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
directory-tree-promise
Advanced tools
npm install directory-tree-promise
Use async await while traversing a directory tree.
const directoryTree = require('directory-tree-promise')
const tree = await directoryTree('./example')
Output of tree
:
{
"path": "./example",
"name": "example",
"children": [
{
"path": "example/subfolder",
"name": "subfolder",
"children": [
// excluded
],
"size": 22
},
{
// excluded
}
],
"size": 34
}
You can also pass an async function as a second parameter to modify the object returned for files
const directoryTree = require('directory-tree-promise')
const tree = await directoryTree('./example', async file => {
file.content = await someFunctionToReadFileData(file.path)
return file
})
Items are returned with the following properties:
Each object in the tree is extended with a function isFile
const directoryTree = require('directory-tree-promise')
const tree = await directoryTree(process.cwd())
tree.children[0].isFile() // true or false
Device, FIFO and socket files are ignored.
Fork this repository and run npm install
in project directory. Before versioning and publishing, run npm dist
to transcompile for Node 6 support.
npm run test
FAQs
Asynchronously return a directory tree as a JS object
We found that directory-tree-promise demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.