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 install ?

Leave a Reply

Your email address will not be published. Required fields are marked *

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