Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

node list folders in directory

const { readdir } = require('fs')

const getDirectories = (source, callback) =>
  readdir(source, { withFileTypes: true }, (err, files) => {
    if (err) {
      callback(err)
    } else {
      callback(
        files
          .filter(dirent => dirent.isDirectory())
          .map(dirent => dirent.name)
      )
    }
  })
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery submit form ajax 
Javascript :: full width of image and maintain aspect ratio react native 
Javascript :: update version of node gyp 
Javascript :: js remove readonly attribute 
Javascript :: settimeout in angular 
Javascript :: check if checkbox is checked jquery 
Javascript :: fetch put request js 
Javascript :: how to set element readonly using jquery 
Javascript :: get meta content jquery 
Javascript :: number with commas js 
Javascript :: get attribute of selected option jquery 
Javascript :: remove header from certain pages react navigation 
Javascript :: breakline in react native 
Javascript :: hr react 
Javascript :: js async anonymous function 
Javascript :: create-react-app 
Javascript :: drupal 8 link render array 
Javascript :: pick a random element from an array javascript 
Javascript :: npm ERR! Fix the upstream dependency conflict, 
Javascript :: alphabets regex js 
Javascript :: shorthand for document.ready 
Javascript :: include partials ejs 
Javascript :: trigger change select element jquery 
Javascript :: content type json 
Javascript :: get browser language 
Javascript :: get href attribute javascript 
Javascript :: gdscript yield timer 
Javascript :: jquery checkbox checked value 
Javascript :: how to convert seconds into days hours seconds js 
Javascript :: bootstrap not working in angular 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =