Skip to content

Get permissions of a given directory with TypeScript

Advertisements
  
import * as fs from "fs"
import * as path from "path"
function getDirectoryPermission(directory: string): number {
    return fs.statSync(directory).mode
}
See also  TypeScript code snippet - How to get all the elements in Hashtable java?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.