Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

check how many files in a folder js

const { promises: fs } = require('fs');
const dir = '/';

const getNumFiles = async (dir) => {
  const files = await fs.readdir(dir)
  console.log(files.length)
}
getNumFiles(dir)
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript merge array 
Javascript :: JavaScript read as Json 
Javascript :: get window width 
Javascript :: execute php 
Javascript :: icon button react 
Javascript :: sequelize sqlite example 
Javascript :: react bootstrap add progress bar 
Javascript :: create an object array in js 
Javascript :: javascript console log whole array 
Javascript :: javascript last child 
Javascript :: angular ng default scss 
Javascript :: How To Open Phone Dialer and Make Call From React Native App 
Javascript :: how to save and use item from local storage javascript 
Javascript :: js array find regex 
Javascript :: foreach break js 
Javascript :: upload preview image jquery 
Javascript :: make form submit on new tab using jquery 
Javascript :: setting timeout in javascript 
Javascript :: email regular expression javascript 
Javascript :: @babel/plugin-proposal-optional-chaining 
Javascript :: storage class 
Javascript :: if between two numbers javascript 
Javascript :: create new element 
Javascript :: copy to clipboard reatjs 
Javascript :: mongoose pagination with total count 
Javascript :: javascript sort array of objects 
Javascript :: Iterate Through an Array with a For Loop 
Javascript :: how to compare objets in an array 
Javascript :: regular expression characters 
Javascript :: checkbox default value and checked value get in jquery 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =