Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

nodejs get all folders in directory

const { readdirSync } = require('fs')

const getDirectories = source =>
  readdirSync(source, { withFileTypes: true })
    .filter(dirent => dirent.isDirectory())
    .map(dirent => dirent.name)
Comment

get all from dir node

const getAllFromDir = source =>
      fs.readdirSync(source).map(name => path.join(source, name));
      console.log(getDirectories("C:/"));
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript confirm delete 
Javascript :: js copy text to clipboard 
Javascript :: How to fix stomp websocket error 
Javascript :: discord js how to mention bot 
Javascript :: angular local storage 
Javascript :: javascript zero pad 
Javascript :: set element position js 
Javascript :: react native use navigation outside component 
Javascript :: asignar val select2 js 
Javascript :: React Redux reducer combineReducers exemple 
Javascript :: how to copy text in js 
Javascript :: javascript number pyramid 
Javascript :: javascript to help find overflow elements 
Javascript :: string contains javascirpt 
Javascript :: mongodb filter empty array 
Javascript :: get element by tag name 
Javascript :: extract numbers from a string javascript 
Javascript :: jquery remove click event 
Javascript :: check if a string contains digits js 
Javascript :: javascript object entries 
Javascript :: how to find length of array js 
Javascript :: js add style to each class 
Javascript :: vue print date 
Javascript :: scroll into view 
Javascript :: test variable type javascript 
Javascript :: vue add script tags and link tags 
Javascript :: javascript dedupe array 
Javascript :: javascript transpose array 
Javascript :: jQuery select elements by name 
Javascript :: loop through map in js 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =