Is this the right way to create a directory if it doesn\'t exist. It should have full permission for the script and readable by others.
var dir = __dirname +
// import const fs = require('fs') // in javascript import * as fs from "fs" // in typescript import fs from "fs" // in typescript // use !fs.existsSync(`./assets/`) && fs.mkdirSync(`./assets/`, { recursive: true })