JSFs

@native @JSImport("fs", Namespace) @JSType object JSFs extends Any

Facade for native nodejs module "fs".

Facade for native nodejs module "fs".

See also
trait Any
class Object
trait Matchable
class Any

Value members

Concrete methods

def existsSync(path: String): Boolean

Returns true if the file exists, false otherwise.

Returns true if the file exists, false otherwise.

def lstatSync(path: String): JSStats

Returns an fs.Stats for path.

Returns an fs.Stats for path.

def mkdirSync(path: String): Unit

Synchronously creates a directory.

Synchronously creates a directory.

def readFileSync(path: String): Array[Int]

Returns the file contents as Buffer using blocking apis.

Returns the file contents as Buffer using blocking apis.

NOTE: The actual return value is a Node.js buffer and not js.Array[Int]. However, both support .length and angle bracket access (foo[1]).

def readFileSync(path: String, encoding: String): String

Returns the file contents as String using blocking apis

Returns the file contents as String using blocking apis

def readdirSync(path: String): Array[String]

Returns an array of filenames excluding '.' and '..'.

Returns an array of filenames excluding '.' and '..'.

def writeFileSync(path: String, buffer: Array[Int]): Unit

Writes file contents using blocking apis

Writes file contents using blocking apis