Liking cljdoc? Tell your friends :D

cljs-node-io.fs

A wrapper around node's fs module.

A wrapper around node's fs module.
raw docstring

absolute?cljs

(absolute? pathstr)

@param {!string} pathstr :: path to test @return {!boolean} is pathstr an absolute path

@param {!string} pathstr :: path to test
@return {!boolean} is pathstr an absolute path
raw docstring

achmodcljs

(achmod pathstr mode)

Asynchronous chmod {@link https://nodejs.org/api/fs.html#fschmodpath-mode-callback} @param {!(string|Buffer|URL)} pathstr @param {!Number} mode :: must be an integer @return {!Channel} yielding [?err]

Asynchronous chmod
{@link https://nodejs.org/api/fs.html#fschmodpath-mode-callback}
@param {!(string|Buffer|URL)} pathstr
@param {!Number} mode :: must be an integer
@return {!Channel} yielding [?err]
raw docstring

achowncljs

(achown pathstr uid gid)

Asynchronous chown {@link https://nodejs.org/api/fs.html#fschownpath-uid-gid-callback} @param {!(string|Buffer|URL)} pathstr @param {!Number} uid @param {!Number} gid @return {!Channel} yielding [?err]

Asynchronous chown
{@link https://nodejs.org/api/fs.html#fschownpath-uid-gid-callback}
@param {!(string|Buffer|URL)} pathstr
@param {!Number} uid
@param {!Number} gid
@return {!Channel} yielding [?err]
raw docstring

aclosecljs

(aclose fd)

Asynchronously close a file-descriptor {@link https://nodejs.org/api/fs.html#fsclosefd-callback} @param {Number} fd :: the file descriptor to close @return {Channel} yielding [?err]

Asynchronously close a file-descriptor
{@link https://nodejs.org/api/fs.html#fsclosefd-callback}
@param {Number} fd :: the file descriptor to close
@return {Channel} yielding [?err]
raw docstring

acopy-filecljs

(acopy-file src dst)
(acopy-file src dst mode)

Asynchronously copy file from src to dst. By default dst is overwritten. {@link https://nodejs.org/api/fs.html#fscopyfilesrc-dest-mode-callback} @param {(string|buffer.Buffer|URL)} src @param {(string|buffer.Buffer|URL)} dst @return {!Channel} yielding [?err]

Asynchronously copy file from src to dst. By default dst is overwritten.
{@link https://nodejs.org/api/fs.html#fscopyfilesrc-dest-mode-callback}
@param {(string|buffer.Buffer|URL)} src
@param {(string|buffer.Buffer|URL)} dst
@return {!Channel} yielding [?err]
raw docstring

acrawlcljs

(acrawl root af)

Asynchronous depth-first recursive crawl through a directory tree, calling the supplied potentially side-effecting function on every node. This function will short and return on an error.

The user supplied function must return a 'result-chan'...a Readport/channel yielding [?err, ?ok]. There is no easy way to get the compiler to enforce this!

@param {!string} root :: where to start the crawl. A file simply returns (af root) @param {!function<string>} af :: async function called on both files & directories @return {!Channel} yields a short circuited [err] or [nil ok]. This depends on the user following the result chan conventions.

Asynchronous depth-first recursive crawl through a directory tree, calling the supplied
potentially side-effecting function on every node. This function will short
and return on an error.

The user supplied function must return a 'result-chan'...a Readport/channel
yielding [?err, ?ok]. There is no easy way to get the compiler to enforce this!

@param {!string} root :: where to start the crawl. A file simply returns (af root)
@param {!function<string>} af :: async function called on both files & directories
@return {!Channel} yields a short circuited [err] or [nil ok].
This depends on the user following the result chan conventions.
raw docstring

adir?cljs

(adir? pathstr)

Asynchronous directory predicate. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding boolean

Asynchronous directory predicate.
@param {!(string|Buffer|URL)} pathstr
@return {!Channel} yielding boolean
raw docstring

aexecutable?cljs

(aexecutable? pathstr)

Asynchronously test if a file is executable to the process @param {!(string|Buffer|URL)} pathstr :: path to test for process execute permission @return {!Channel} yielding boolean

Asynchronously test if a file is executable to the process
@param {!(string|Buffer|URL)} pathstr :: path to test for process execute permission
@return {!Channel} yielding boolean
raw docstring

aexists?cljs

(aexists? pathstr)

Asynchronously test if a file or directory exists @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding boolean

Asynchronously test if a file or directory exists
@param {!(string|Buffer|URL)} pathstr
@return {!Channel} yielding boolean
raw docstring

afexists?cljs

@deprecated

@deprecated
raw docstring

afile?cljs

(afile? pathstr)

Asynchronous file predicate. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding boolean

Asynchronous file predicate.
@param {!(string|Buffer|URL)} pathstr
@return {!Channel} yielding boolean
raw docstring

afstatcljs

(afstat fd)

Asynchronously retrieve a stats map from the file descriptor {@link https://nodejs.org/api/fs.html#fsfstatfd-options-callback} @param {!Number} fd @param {!Channel} yielding [?err edn-stats]

Asynchronously retrieve a stats map from the file descriptor
{@link https://nodejs.org/api/fs.html#fsfstatfd-options-callback}
@param {!Number} fd
@param {!Channel} yielding [?err edn-stats]
raw docstring

afsynccljs

(afsync fd)

Asynchronously flush to storage {@link https://nodejs.org/api/fs.html#fsfsyncfd-callback} @param {!Number} fd @return {Channel} yielding [?err]

Asynchronously flush to storage
{@link https://nodejs.org/api/fs.html#fsfsyncfd-callback}
@param {!Number} fd
@return {Channel} yielding [?err]
raw docstring

aftruncatecljs

(aftruncate fd)
(aftruncate fd len)

Asynchronous ftruncate {@link https://nodejs.org/api/fs.html#fsftruncatefd-len-callback} @param {!Number} fd @param {?Number} len @return {!Channel} yielding [?err]

Asynchronous ftruncate
{@link https://nodejs.org/api/fs.html#fsftruncatefd-len-callback}
@param {!Number} fd
@param {?Number} len
@return {!Channel} yielding [?err]
raw docstring

alchowncljs

(alchown pathstr uid gid)

Asynchronous lchown {@link https://nodejs.org/api/fs.html#fslchownpath-uid-gid-callback} @param {!(string|Buffer|URL)} pathstr @param {!Number} uid @param {!Number} gid @return {!Channel} yielding [?err]

Asynchronous lchown
{@link https://nodejs.org/api/fs.html#fslchownpath-uid-gid-callback}
@param {!(string|Buffer|URL)} pathstr
@param {!Number} uid
@param {!Number} gid
@return {!Channel} yielding [?err]
raw docstring

(alink src dst)

Asynchronously creates a new link from the src to dst. Will not overwrite newpath if it exists. {@link https://nodejs.org/api/fs.html#fslinkexistingpath-newpath-callback} @param {!(string|Buffer|URL)} src @param {!(string|Buffer|URL)} dst @return {!Channel} yielding [?err]

Asynchronously creates a new link from the src to dst.
Will not overwrite newpath if it exists.
{@link https://nodejs.org/api/fs.html#fslinkexistingpath-newpath-callback}
@param {!(string|Buffer|URL)} src
@param {!(string|Buffer|URL)} dst
@return {!Channel} yielding [?err]
raw docstring

alock-filecljs

(alock-file pathstr)

Attempts to asynchronously open a lock-file exclusively. This prevents future openings until the holding lock has been released, thereby can use to prevent reads and writes within a process. A yielded err indicates a failure to obtain a lock, & AsyncLockFile is a record with .release() method to unlock the file, returning a promise-chan yielding [?err] @param {string} pathstr :: the file you want to lock @return {Channel} yielding [?err ?AsyncLockFile]

Attempts to asynchronously open a lock-file exclusively. This prevents
future openings until the holding lock has been released, thereby can
use to prevent reads and writes within a process.
A yielded err indicates a failure to obtain a lock, & AsyncLockFile is a
record with .release() method to unlock the file, returning a promise-chan
yielding [?err]
@param {string} pathstr :: the file you want to lock
@return {Channel} yielding [?err ?AsyncLockFile]
raw docstring

alstatcljs

(alstat pathstr)

Asynchronous lstat @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err ?edn-stats]

Asynchronous lstat
@param {!(string|Buffer|URL)} pathstr
@return {!Channel} yielding [?err ?edn-stats]
raw docstring

alutimescljs

(alutimes pathstr atime mtime)

asynchronous lutimes

  • same as utimes but symbolic links are not derefed
  • If the value is NaN or Infinity, the value would get converted to Date.now()
  • numerable strings ie '12235' are converted to numbers {@link https://nodejs.org/api/fs.html#fslutimespath-atime-mtime-callback} @param {!(string|Buffer|URL)} pathstr @param {(string|Number)} atime @param {(string|Number)} mtime @return {!Channel} yielding [?err]
asynchronous lutimes
- same as utimes but symbolic links are not derefed
- If the value is NaN or Infinity, the value would get converted to Date.now()
- numerable strings ie '12235' are converted to numbers
{@link https://nodejs.org/api/fs.html#fslutimespath-atime-mtime-callback}
@param {!(string|Buffer|URL)} pathstr
@param {(string|Number)} atime
@param {(string|Number)} mtime
@return {!Channel} yielding [?err]
raw docstring

amkdircljs

(amkdir pathstr)
(amkdir pathstr opts)

Asynchronously create a directory {@link https://nodejs.org/api/fs.html#fsmkdirpath-options-callback} @param {!(string|Buffer|URL)} pathstr :: path of directory to create @param {?IMap} opts :recursive (boolean) -> the first directory path created. :mode (string|number) @return {!Channel} yielding [?err]

Asynchronously create a directory
{@link https://nodejs.org/api/fs.html#fsmkdirpath-options-callback}
@param {!(string|Buffer|URL)} pathstr :: path of directory to create
@param {?IMap} opts
 :recursive (boolean) -> the first directory path created.
 :mode (string|number)
@return {!Channel} yielding [?err]
raw docstring

aopencljs

(aopen pathstr)
(aopen pathstr flags)
(aopen pathstr flags mode)

Asynchronously open a file-descriptor {@link https://nodejs.org/api/fs.html#fsopenpath-flags-mode-callback} @param {!string} pathstr @return {!Channel} yielding [?err ?fd]

Asynchronously open a file-descriptor
{@link https://nodejs.org/api/fs.html#fsopenpath-flags-mode-callback}
@param {!string} pathstr
@return {!Channel} yielding [?err ?fd]
raw docstring

areadcljs

(aread fd opts)
(aread fd buffer opts)
(aread fd buffer offset length position)

Asynchronously read data from the fd into the specified buffer {@link https://nodejs.org/api/fs.html#fsreadfd-buffer-offset-length-position-callback} Can pass arguments individually or as a map: :buffer (Buffer|ArrayBuffer) - where data will be written :offset (Number) - where to start writing in the buffer :length (Number) - how many bytes to read from fd :pos (Number|Bigint) - Where to begin reading. if -1 reads from current-pos @return {!Channel} yielding [?err bytes-read buffer]

Asynchronously read data from the fd into the specified buffer
{@link https://nodejs.org/api/fs.html#fsreadfd-buffer-offset-length-position-callback}
Can pass arguments individually or as a map:
  :buffer (Buffer|ArrayBuffer) - where data will be written
  :offset (Number) - where to start writing in the buffer
  :length (Number) - how many bytes to read from fd
  :pos (Number|Bigint) - Where to begin reading. if -1 reads from current-pos
@return {!Channel} yielding [?err bytes-read buffer]
raw docstring

aread-filecljs

(aread-file pathstr enc)

@param {!string} pathstr @param {!string} enc :: if "" (an explicit empty string) => raw buffer @return {!Channel} yielding [?err (str|Buffer)]

@param {!string} pathstr
@param {!string} enc :: if "" (an explicit empty string) => raw buffer
@return {!Channel} yielding [?err (str|Buffer)]
raw docstring

areadable?cljs

(areadable? pathstr)

Asynchronously test if a file is readable to the process @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding boolean

Asynchronously test if a file is readable to the process
@param {!(string|Buffer|URL)} pathstr
@return {!Channel} yielding boolean
raw docstring

areaddircljs

(areaddir dirpath)
(areaddir dirpath opts)

Asynchronously reads directory content {@link https://nodejs.org/api/fs.html#fsreaddirpath-options-callback} @param {!(string|Buffer|URL)} dirpath :: directory path to read @param {?IMap} opts :: options :encoding (string) -> defaults to 'utf8' :withFileTypes (bool) -> return fs.Dirent objects instead of strings. see {@link https://nodejs.org/api/fs.html#class-fsdirent} @return {!Channel} yielding [?err, ?Vector<string|fs.Dirent>]

Asynchronously reads directory content
{@link https://nodejs.org/api/fs.html#fsreaddirpath-options-callback}
@param {!(string|Buffer|URL)} dirpath :: directory path to read
@param {?IMap} opts :: options
  :encoding (string) -> defaults to 'utf8'
  :withFileTypes (bool) -> return fs.Dirent objects instead of strings. see
    {@link https://nodejs.org/api/fs.html#class-fsdirent}
@return {!Channel} yielding [?err, ?Vector<string|fs.Dirent>]
raw docstring

(areadlink pathstr)

Asynchronous readlink. Reads the contents of the symbolic link referred to by path. {@link https://nodejs.org/api/fs.html#fsreadlinkpath-options-callback} @param {!(string|Buffer|URL)} pathstr :: the symbolic link to read @return {!Channel} yielding [?err ?linkstring]

Asynchronous readlink.
Reads the contents of the symbolic link referred to by path.
{@link https://nodejs.org/api/fs.html#fsreadlinkpath-options-callback}
@param {!(string|Buffer|URL)} pathstr :: the symbolic link to read
@return {!Channel} yielding [?err ?linkstring]
raw docstring

arealpathcljs

(arealpath pathstr)

Asynchronous realpath. Computes the canonical pathname by resolving ., .., and symbolic links. {@link https://nodejs.org/api/fs.html#fsrealpathpath-options-callback} @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err ?resolvedPathstr]

Asynchronous realpath.
Computes the canonical pathname by resolving ., .., and symbolic links.
{@link https://nodejs.org/api/fs.html#fsrealpathpath-options-callback}
@param {!(string|Buffer|URL)} pathstr
@return {!Channel} yielding [?err ?resolvedPathstr]
raw docstring

arenamecljs

(arename oldpathstr newpathstr)

Asynchronously rename a file {@link https://nodejs.org/api/fs.html#fsrenameoldpath-newpath-callback} @param {!(string|Buffer|URL)} oldpathstr :: file to rename @param {!(string|Buffer|URL)} newpathstr :: what to rename it to @return {!Channel} yielding [?err]

Asynchronously rename a file
{@link https://nodejs.org/api/fs.html#fsrenameoldpath-newpath-callback}
@param {!(string|Buffer|URL)} oldpathstr :: file to rename
@param {!(string|Buffer|URL)} newpathstr :: what to rename it to
@return {!Channel} yielding [?err]
raw docstring

armcljs

(arm pathstr)

Asynchronously delete the file or directory path @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err]

Asynchronously delete the file or directory path
@param {!(string|Buffer|URL)} pathstr
@return {!Channel} yielding [?err]
raw docstring

arm-fcljs

(arm-f pathstr)

Asynchronously delete the file or directory path Ignores paths that do not exist. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err]

Asynchronously delete the file or directory path
Ignores paths that do not exist.
@param {!(string|Buffer|URL)} pathstr
@return {!Channel} yielding [?err]
raw docstring

arm-rcljs

(arm-r pathstr)

Asynchronous recursive delete. Ignores paths that do not exist. Crawls in order provided by readdir and makes unlink/rmdir calls sequentially after the previous has completed. Breaks on any err which is returned as [err] Returns err on does not exist. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err]

Asynchronous recursive delete. Ignores paths that do not exist.
Crawls in order provided by readdir and makes unlink/rmdir calls sequentially
after the previous has completed. Breaks on any err which is returned as [err]
Returns err on does not exist.
@param {!(string|Buffer|URL)} pathstr
@return {!Channel} yielding [?err]
raw docstring

arm-rfcljs

(arm-rf pathstr)

Asynchronous recursive delete. Ignores paths that do not exist. Crawls in order provided by readdir and makes unlink/rmdir calls sequentially after the previous has completed. Breaks on any err which is returned as [err] Returns err on does not exist. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err]

Asynchronous recursive delete. Ignores paths that do not exist.
Crawls in order provided by readdir and makes unlink/rmdir calls sequentially
after the previous has completed. Breaks on any err which is returned as [err]
Returns err on does not exist.
@param {!(string|Buffer|URL)} pathstr
@return {!Channel} yielding [?err]
raw docstring

armdircljs

(armdir pathstr)
(armdir pathstr opts)

Asynchronously remove a directory {@link https://nodejs.org/api/fs.html#fsrmdirpath-options-callback} @param {!(string|Buffer|URL)} pathstr :: path of directory to remove @param {?IMap} opts :maxRetries (number) :retryDelay (number) @return {!Channel} yielding [?err]

Asynchronously remove a directory
{@link https://nodejs.org/api/fs.html#fsrmdirpath-options-callback}
@param {!(string|Buffer|URL)} pathstr :: path of directory to remove
@param {?IMap} opts
  :maxRetries (number)
  :retryDelay (number)
@return {!Channel} yielding [?err]
raw docstring

astatcljs

(astat pathstr)

Asynchronous stat @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err ?edn-stats]

Asynchronous stat
@param {!(string|Buffer|URL)} pathstr
@return {!Channel} yielding [?err ?edn-stats]
raw docstring

(asymlink targetstr pathstr)
(asymlink targetstr pathstr link_type)

Synchronous symlink. {@link https://nodejs.org/api/fs.html#fssymlinktarget-path-type-callback} @param {!(string|Buffer|URL)} targetstr :: what gets pointed to @param {!(string|Buffer|URL)} pathstr :: the new symbolic link that points to target @param {?string} link_type ::'file' or 'dir' @return {!Channel} yielding [?err]

Synchronous symlink.
{@link https://nodejs.org/api/fs.html#fssymlinktarget-path-type-callback}
@param {!(string|Buffer|URL)} targetstr :: what gets pointed to
@param {!(string|Buffer|URL)} pathstr :: the new symbolic link that points to target
@param {?string} link_type ::'file' or 'dir'
@return {!Channel} yielding [?err]
raw docstring

asymlink?cljs

(asymlink? pathstr)

Asynchronously test if path is a symbolic link @param {!(string|Buffer|URL)} pathstr :: path to test @return {!Channel} yielding boolean

Asynchronously test if path is a symbolic link
@param {!(string|Buffer|URL)} pathstr :: path to test
@return {!Channel} yielding boolean
raw docstring

AsyncLockFilecljs


atouchcljs

(atouch pathstr)

creates a file if non-existent @param {!string} pathstr @return {!Channel} yielding [?err]

creates a file if non-existent
@param {!string} pathstr
@return {!Channel} yielding [?err]
raw docstring

atruncatecljs

(atruncate pathstr)
(atruncate pathstr len)

Asynchronous truncate {@link https://nodejs.org/api/fs.html#fstruncatepath-len-callback} @param {!(string|Buffer|URL)} pathstr @param {?number} len @return {!Channel} yielding [?err]

Asynchronous truncate
{@link https://nodejs.org/api/fs.html#fstruncatepath-len-callback}
@param {!(string|Buffer|URL)} pathstr
@param {?number} len
@return {!Channel} yielding [?err]
raw docstring

(aunlink pathstr)

Asynchronously unlink a file {@link https://nodejs.org/api/fs.html#fsunlinkpath-callback} @param {!(string|Buffer|URL)} pathstr :: path of file to unlink @return {!Channel} yielding [?err]

Asynchronously unlink a file
{@link https://nodejs.org/api/fs.html#fsunlinkpath-callback}
@param {!(string|Buffer|URL)} pathstr :: path of file to unlink
@return {!Channel} yielding [?err]
raw docstring

autimescljs

(autimes pathstr atime mtime)

asynchronous utimes. Change the file system timestamps of the object referenced by path.

  • If the value is NaN or Infinity, the value would get converted to Date.now()
  • numerable strings ie '12235' are converted to numbers {@link https://nodejs.org/api/fs.html#fsutimespath-atime-mtime-callback} @param {!(string|Buffer|URL)} pathstr @param {(string|Number)} atime @param {(string|Number)} mtime @return {!Channel} yielding [?err]
asynchronous utimes.
Change the file system timestamps of the object referenced by path.
- If the value is NaN or Infinity, the value would get converted to Date.now()
- numerable strings ie '12235' are converted to numbers
{@link https://nodejs.org/api/fs.html#fsutimespath-atime-mtime-callback}
@param {!(string|Buffer|URL)} pathstr
@param {(string|Number)} atime
@param {(string|Number)} mtime
@return {!Channel} yielding [?err]
raw docstring

awritable?cljs

(awritable? pathstr)

Asynchronously test if a file is writable to the process @param {!(string|Buffer|URL)} pathstr :: path to test for process write permission @return {!Channel} yielding boolean

Asynchronously test if a file is writable to the process
@param {!(string|Buffer|URL)} pathstr :: path to test for process write permission
@return {!Channel} yielding boolean
raw docstring

awritecljs

(awrite fd opts)
(awrite fd buffer opts)
(awrite fd buffer offset length position)

Asynchronously write data from the buffer to the fd {@link https://nodejs.org/api/fs.html#fswritesyncfd-buffer-offset-length-position} Can pass arguments individually or as a map: :buffer (Buffer|ArrayBuffer) - data to be written :offset (Number) - where to start reading in the buffer :length (Number) - how many bytes to read :pos (Number|Bigint) - where to begin writing in the fd @return {!Channel} yielding [?err bytes-written buffer]

Asynchronously write data from the buffer to the fd
{@link https://nodejs.org/api/fs.html#fswritesyncfd-buffer-offset-length-position}
Can pass arguments individually or as a map:
  :buffer (Buffer|ArrayBuffer) - data to be written
  :offset (Number) - where to start reading in the buffer
  :length (Number) - how many bytes to read
  :pos (Number|Bigint) - where to begin writing in the fd
@return {!Channel} yielding [?err bytes-written buffer]
raw docstring

awrite-filecljs

(awrite-file pathstring content opts)

Asynchronously write to a file. @param {!string} pathstring : file to write to @param {(string|buffer.Buffer)} content : if buffer, :encoding is ignored @param {?IMap} opts : :encoding {string}, :append {bool}, :flags {string}, :mode {int}

  • flags override append @return {!Channel} promise-chan recieving [?err]
Asynchronously write to a file.
@param {!string} pathstring : file to write to
@param {(string|buffer.Buffer)} content : if buffer, :encoding is ignored
@param {?IMap} opts : :encoding {string}, :append {bool}, :flags {string}, :mode {int}
 - flags override append
@return {!Channel} promise-chan recieving [?err]
raw docstring

basenamecljs

(basename pathstring)
(basename pathstring ext)

@return {!string}

@return {!string}
raw docstring

chmodcljs

(chmod pathstr mode)

Synchronous chmod {@link https://nodejs.org/api/fs.html#fsfchmodsyncfd-mode} @param {!(string|Buffer|URL)} pathstr @param {!Number} mode :: must be an integer @return {nil}

Synchronous chmod
{@link https://nodejs.org/api/fs.html#fsfchmodsyncfd-mode}
@param {!(string|Buffer|URL)} pathstr
@param {!Number} mode :: must be an integer
@return {nil}
raw docstring

chowncljs

(chown pathstr uid gid)

Synchronous chown {@link https://nodejs.org/api/fs.html#fschownsyncpath-uid-gid} @param {!(string|Buffer|URL)} pathstr @param {!Number} uid @param {!Number} gid @return {nil}

Synchronous chown
{@link https://nodejs.org/api/fs.html#fschownsyncpath-uid-gid}
@param {!(string|Buffer|URL)} pathstr
@param {!Number} uid
@param {!Number} gid
@return {nil}
raw docstring

closecljs

(close fd)

Synchronously close a file-descriptor {@link https://nodejs.org/api/fs.html#fsclosesyncfd} @param {Number} fd :: the file descriptor to close @return {nil}

Synchronously close a file-descriptor
{@link https://nodejs.org/api/fs.html#fsclosesyncfd}
@param {Number} fd :: the file descriptor to close
@return {nil}
raw docstring

copy-filecljs

(copy-file src dst)
(copy-file src dst mode)

Synchronously copy file from src to dst. By default dst is overwritten. {@link https://nodejs.org/api/fs.html#fscopyfilesyncsrc-dest-mode} @param {(string|buffer.Buffer|URL)} src @param {(string|buffer.Buffer|URL)} dst @return {nil}

Synchronously copy file from src to dst. By default dst is overwritten.
{@link https://nodejs.org/api/fs.html#fscopyfilesyncsrc-dest-mode}
@param {(string|buffer.Buffer|URL)} src
@param {(string|buffer.Buffer|URL)} dst
@return {nil}
raw docstring

crawlcljs

(crawl root f)

Synchronous depth-first recursive crawl through a directory tree, calling the supplied side-effecting function on every node. This function will throw if your supplied f throws on any node. @param {!string} root :: where to start the crawl. A file simply returns (f root) @param {!function<string>} f :: function called on both files & directories returns value of (f top-level-root)

Synchronous depth-first recursive crawl through a directory tree, calling the supplied
side-effecting function on every node. This function will throw if your supplied
f throws on any node.
@param {!string} root :: where to start the crawl. A file simply returns (f root)
@param {!function<string>} f :: function called on both files & directories
returns value of (f top-level-root)
raw docstring

dir?cljs

(dir? pathstr)

@param {!(string|Buffer|URL)} pathstring @return {!boolean} iff abstract pathname exists and is a directory

@param {!(string|Buffer|URL)} pathstring
@return {!boolean} iff abstract pathname exists and is a directory
raw docstring

dirnamecljs

(dirname pathstring)

@param {!string} pathstring :: path to get parent of @return {!string} the parent directory

@param {!string} pathstring :: path to get parent of
@return {!string} the parent directory
raw docstring

executable?cljs

(executable? pathstr)

@param {!(string|Buffer|URL)} pathstr :: path to test for process executable permission @return {!boolean}

@param {!(string|Buffer|URL)} pathstr :: path to test for process executable permission
@return {!boolean}
raw docstring

exists?cljs

(exists? pathstr)

Synchronously test if a file or directory exists @param {!(string|Buffer|URL)} pathstr :: file path to test @return {!boolean}

Synchronously test if a file or directory exists
@param {!(string|Buffer|URL)} pathstr :: file path to test
@return {!boolean}
raw docstring

extcljs

(ext pathstring)

@param {!string} pathstring :: file to get extension from @return {!string}

@param {!string} pathstring :: file to get extension from
@return {!string}
raw docstring

fexists?cljs

@deprecated

@deprecated
raw docstring

file?cljs

(file? pathstr)

Synchronous file predicate @param {!(string|Buffer|URL)} pathstring @return {!boolean} iff abstract pathname exists and is a file

Synchronous file predicate
@param {!(string|Buffer|URL)} pathstring
@return {!boolean} iff abstract pathname exists and is a file
raw docstring

fscljs


fstatcljs

(fstat fd)

Synchronously retrieve a stats map from the file descriptor {@link https://nodejs.org/api/fs.html#fsfstatsyncfd-options} @param {!Number} fd @return {!IMap} edn stats

Synchronously retrieve a stats map from the file descriptor
{@link https://nodejs.org/api/fs.html#fsfstatsyncfd-options}
@param {!Number} fd
@return {!IMap} edn stats
raw docstring

fsynccljs

(fsync fd)

Synchronously flush to storage {@link https://nodejs.org/api/fs.html#fsfstatsyncfd-options} @param {!Number} fd @return {nil}

Synchronously flush to storage
{@link https://nodejs.org/api/fs.html#fsfstatsyncfd-options}
@param {!Number} fd
@return {nil}
raw docstring

ftruncatecljs

(ftruncate fd)
(ftruncate fd len)

Synchronous ftruncate {@link https://nodejs.org/api/fs.html#fsftruncatesyncfd-len} @param {!Number} fd @param {?Number} len @return {nil}

Synchronous ftruncate
{@link https://nodejs.org/api/fs.html#fsftruncatesyncfd-len}
@param {!Number} fd
@param {?Number} len
@return {nil}
raw docstring

gid-uidcljs

(gid-uid)

@return {!IMap}

@return {!IMap}
raw docstring

hidden?cljs

(hidden? pathstr)

@param {!(string|Buffer|URL)} pathstr @return {!boolean} is the file hidden (unix only)

@param {!(string|Buffer|URL)} pathstr
@return {!boolean} is the file hidden (unix only)
raw docstring

lchowncljs

(lchown pathstr uid gid)

Synchronous lchown {@link https://nodejs.org/api/fs.html#fslchownsyncpath-uid-gid} @param {!(string|Buffer|URL)} pathstr @param {!Number} uid @param {!Number} gid @return {nil}

Synchronous lchown
{@link https://nodejs.org/api/fs.html#fslchownsyncpath-uid-gid}
@param {!(string|Buffer|URL)} pathstr
@param {!Number} uid
@param {!Number} gid
@return {nil}
raw docstring

(link src dst)

Synchronously creates a new link from the src to dst Will not overwrite newpath if it exists. {@link https://nodejs.org/api/fs.html#fslinksyncexistingpath-newpath} @param {!(string|Buffer|URL)} src @param {!(string|Buffer|URL)} dst @return {nil}

Synchronously creates a new link from the src to dst
Will not overwrite newpath if it exists.
{@link https://nodejs.org/api/fs.html#fslinksyncexistingpath-newpath}
@param {!(string|Buffer|URL)} src
@param {!(string|Buffer|URL)} dst
@return {nil}
raw docstring

lock-filecljs

(lock-file pathstr)

Attempts to synchronously open a lock-file exclusively. This prevents future openings until the holding lock has been released, thereby can use to prevent reads and writes within a process. If a lock is already held, will throw @param {string} pathstr :: the file you want to lock @return {LockFile} record with .release() method to unlock the file

Attempts to synchronously open a lock-file exclusively. This prevents
future openings until the holding lock has been released, thereby can
use to prevent reads and writes within a process.
If a lock is already held, will throw
@param {string} pathstr :: the file you want to lock
@return {LockFile} record with .release() method to unlock the file
raw docstring

lock-pathcljs

(lock-path pathstr)

LockFilecljs


lstatcljs

(lstat pathstr)

Synchronous lstat identical to stat(), except that if path is a symbolic link, then the link itself is stat-ed, not the file that it refers to @param {!(string|Buffer|URL)} pathstr @return {!IMap} file stats object converted to edn

Synchronous lstat identical to stat(), except that if path is a symbolic link,
then the link itself is stat-ed, not the file that it refers to
@param {!(string|Buffer|URL)} pathstr
@return {!IMap} file stats object converted to edn
raw docstring

lutimescljs

(lutimes pathstr atime mtime)

synchronous lutimes

  • same as utimes but symbolic links are not derefed
  • If the value is NaN or Infinity, the value would get converted to Date.now()
  • numerable strings ie '12235' are converted to numbers {@link https://nodejs.org/api/fs.html#fslutimessyncpath-atime-mtime} @param {!(string|Buffer|URL)} pathstr @param {(string|Number)} atime @param {(string|Number)} mtime @return {nil}
synchronous lutimes
- same as utimes but symbolic links are not derefed
- If the value is NaN or Infinity, the value would get converted to Date.now()
- numerable strings ie '12235' are converted to numbers
{@link https://nodejs.org/api/fs.html#fslutimessyncpath-atime-mtime}
@param {!(string|Buffer|URL)} pathstr
@param {(string|Number)} atime
@param {(string|Number)} mtime
@return {nil}
raw docstring

mkdircljs

(mkdir pathstr)
(mkdir pathstr opts)

Synchronously create a directory {@link https://nodejs.org/api/fs.html#fsmkdirsyncpath-options} @param {!(string|Buffer|URL)} pathstr :: path of directory to create @param {?IMap} opts :recursive (boolean) -> the first directory path created. :mode (string|Number) @return {nil}

Synchronously create a directory
{@link https://nodejs.org/api/fs.html#fsmkdirsyncpath-options}
@param {!(string|Buffer|URL)} pathstr :: path of directory to create
@param {?IMap} opts
  :recursive (boolean) -> the first directory path created.
  :mode (string|Number)
@return {nil}
raw docstring

normalize-pathcljs

(normalize-path pathstring)

@param {!string} pathstring :: pathstring to normalize @return {!string}

@param {!string} pathstring :: pathstring to normalize
@return {!string}
raw docstring

opencljs

(open pathstr)
(open pathstr flags)
(open pathstr flags mode)

Synchronously open a file-descriptor {@link https://nodejs.org/api/fs.html#fsopenpath-flags-mode-callback} @param {!string} pathstr @return {!Number} integer file-descriptor

Synchronously open a file-descriptor
{@link https://nodejs.org/api/fs.html#fsopenpath-flags-mode-callback}
@param {!string} pathstr
@return {!Number} integer file-descriptor
raw docstring

pathcljs


permissionscljs

(permissions st)

@param {!(fs.Stat|IMap)} s :: a fs.Stats object (or as edn) @return {!Number}

@param {!(fs.Stat|IMap)} s :: a fs.Stats object (or as edn)
@return {!Number}
raw docstring

readcljs

(read fd opts)
(read fd buffer opts)
(read fd buffer offset length position)

Synchronously read data from the fd into the specified buffer {@link https://nodejs.org/api/fs.html#fsreadsyncfd-buffer-offset-length-position} Can pass arguments individually or as a map: :buffer (Buffer|ArrayBuffer) - where data will be written :offset (Number) - where to start writing in the buffer :length (Number) - how many bytes to read from fd :pos (Number|Bigint) - Where to begin reading. if -1 reads from current-pos @return {!Number} number of bytes read

Synchronously read data from the fd into the specified buffer
{@link https://nodejs.org/api/fs.html#fsreadsyncfd-buffer-offset-length-position}
Can pass arguments individually or as a map:
  :buffer (Buffer|ArrayBuffer) - where data will be written
  :offset (Number) - where to start writing in the buffer
  :length (Number) - how many bytes to read from fd
  :pos (Number|Bigint) - Where to begin reading. if -1 reads from current-pos
@return {!Number} number of bytes read
raw docstring

read-filecljs

(read-file pathstr enc)

@param {!string} pathstr :: the file path to read @param {!string} enc :: encoding , if "" (an explicit empty string), => raw buffer @return {(buffer.Buffer|string)}

@param {!string} pathstr :: the file path to read
@param {!string} enc :: encoding , if "" (an explicit empty string), => raw buffer
@return {(buffer.Buffer|string)}
raw docstring

readable?cljs

(readable? pathstr)

Synchronously test if a file is readable to the process @param {!(string|Buffer|URL)} pathstr :: path to test for process read permission @return {!boolean}

Synchronously test if a file is readable to the process
@param {!(string|Buffer|URL)} pathstr :: path to test for process read permission
@return {!boolean}
raw docstring

readdircljs

(readdir dirpath)
(readdir dirpath opts)

Synchronously reads directory content {@link https://nodejs.org/api/fs.html#fsreaddirsyncpath-options} @param {!(string|Buffer|URL)} dirpath :: directory path to read @param {?IMap} opts :: options :encoding (string) -> defaults to 'utf8' :withFileTypes (bool) -> return fs.Dirent objects instead of strings. see {@link https://nodejs.org/api/fs.html#class-fsdirent} @return {!IVector} Vector<strings> representing directory content

Synchronously reads directory content
{@link https://nodejs.org/api/fs.html#fsreaddirsyncpath-options}
@param {!(string|Buffer|URL)} dirpath :: directory path to read
@param {?IMap} opts :: options
  :encoding (string) -> defaults to 'utf8'
  :withFileTypes (bool) -> return fs.Dirent objects instead of strings. see
    {@link https://nodejs.org/api/fs.html#class-fsdirent}
@return {!IVector} Vector<strings> representing directory content
raw docstring

readlinecljs

(readline pathstr)

A simple file line reader. @param {!string} pathstr @return {!Channel} chan receiving [?err ?line] until file is consumed, and then the channel closes.

A simple file line reader.
@param {!string} pathstr
@return {!Channel} chan receiving [?err ?line] until file is consumed,
and then the channel closes.
raw docstring

(readlink pathstr)

Synchronous readlink. Reads the contents of the symbolic link referred to by path. {@link https://nodejs.org/api/fs.html#fsreadlinksyncpath-options} @param {!(string|Buffer|URL)} pathstr :: the symbolic link to read @return {!string} the symbolic link's string value

Synchronous readlink.
Reads the contents of the symbolic link referred to by path.
{@link https://nodejs.org/api/fs.html#fsreadlinksyncpath-options}
@param {!(string|Buffer|URL)} pathstr :: the symbolic link to read
@return {!string} the symbolic link's string value
raw docstring

realpathcljs

(realpath pathstr)

Synchronous realpath Computes the canonical pathname by resolving ., .., and symbolic links. {@link https://nodejs.org/api/fs.html#fsrealpathsyncpath-options} @param {!(string|Buffer|URL)} pathstr @return {!string} resolved path

Synchronous realpath
Computes the canonical pathname by resolving ., .., and symbolic links.
{@link https://nodejs.org/api/fs.html#fsrealpathsyncpath-options}
@param {!(string|Buffer|URL)} pathstr
@return {!string} resolved path
raw docstring

renamecljs

(rename oldpathstr newpathstr)

Synchronously rename a file. {@link https://nodejs.org/api/fs.html#fsrenamesyncoldpath-newpath} @param {!(string|Buffer|URL)} oldpathstr :: file to rename @param {!(string|Buffer|URL)} newpathstr :: what to rename it to @return {nil}

Synchronously rename a file.
{@link https://nodejs.org/api/fs.html#fsrenamesyncoldpath-newpath}
@param {!(string|Buffer|URL)} oldpathstr :: file to rename
@param {!(string|Buffer|URL)} newpathstr :: what to rename it to
@return {nil}
raw docstring

resolve-pathcljs

(resolve-path & paths)

@return {!string}

@return {!string}
raw docstring

rlcljs


rmcljs

(rm pathstr)

Synchronously delete the file or directory path @param {!string} pathstr :: can be file or directory @return {nil}

Synchronously delete the file or directory path
@param {!string} pathstr :: can be file or directory
@return {nil}
raw docstring

rm-fcljs

(rm-f pathstr)

Synchronously delete the file or directory path Ignores paths that do not exist. @param {!string} pathstr :: can be file or directory @return {nil}

Synchronously delete the file or directory path
Ignores paths that do not exist.
@param {!string} pathstr :: can be file or directory
@return {nil}
raw docstring

rm-rcljs

(rm-r pathstr)

Synchronous recursive delete. Throws when doesnt exist @param {!(string|Buffer|URL)} pathstr :: file/dir to recursively delete. @return {nil}

Synchronous recursive delete. Throws when doesnt exist
@param {!(string|Buffer|URL)} pathstr :: file/dir to recursively delete.
@return {nil}
raw docstring

rm-rfcljs

(rm-rf pathstr)

Synchronous recursive delete. Ignores paths that do not exist. @param {!(string|Buffer|URL)} pathstr :: file/dir to recursively delete. @return {nil}

Synchronous recursive delete. Ignores paths that do not exist.
@param {!(string|Buffer|URL)} pathstr :: file/dir to recursively delete.
@return {nil}
raw docstring

rmdircljs

(rmdir pathstr)
(rmdir pathstr opts)

Synchronously remove a directory. {@link https://nodejs.org/api/fs.html#fsrmdirsyncpath-options} @param {!(string|Buffer|URL)} pathstr :: path of directory to remove @param {?IMap} opts :maxRetries (number) :retryDelay (number) @return {nil}

Synchronously remove a directory.
{@link https://nodejs.org/api/fs.html#fsrmdirsyncpath-options}
@param {!(string|Buffer|URL)} pathstr :: path of directory to remove
@param {?IMap} opts
  :maxRetries (number)
  :retryDelay (number)
@return {nil}
raw docstring

sepcljs

@type {!string}

@type {!string}
raw docstring

statcljs

(stat pathstr)

Synchronous stat @param {!(string|Buffer|URL)} pathstring @return {!IMap} file stats object converted to edn

Synchronous stat
@param {!(string|Buffer|URL)} pathstring
@return {!IMap} file stats object converted to edn
raw docstring

(symlink target pathstr)
(symlink target pathstr link_type)

Synchronous symlink. {@link https://nodejs.org/api/fs.html#fssymlinksynctarget-path-type} @param {!(string|Buffer|URL)} target :: what gets pointed to @param {!(string|Buffer|URL)} pathstr :: the new symbolic link that points to target @param {?string} link_type ::'file' or 'dir' @return {nil}

Synchronous symlink.
{@link https://nodejs.org/api/fs.html#fssymlinksynctarget-path-type}
@param {!(string|Buffer|URL)} target :: what gets pointed to
@param {!(string|Buffer|URL)} pathstr :: the new symbolic link that points to target
@param {?string} link_type ::'file' or 'dir'
@return {nil}
raw docstring

symlink?cljs

(symlink? pathstr)

Synchronous test for symbolic link @param {!(string|Buffer|URL)} pathstr :: path to test @return {!boolean}

Synchronous test for symbolic link
@param {!(string|Buffer|URL)} pathstr :: path to test
@return {!boolean}
raw docstring

touchcljs

(touch pathstr)

Creates a file if non-existent @param {!string} pathstr @return {nil}

Creates a file if non-existent
@param {!string} pathstr
@return {nil}
raw docstring

truncatecljs

(truncate pathstr)
(truncate pathstr length)

Synchronous truncate {@link https://nodejs.org/api/fs.html#fstruncatesyncpath-len} @param {!(string|Buffer|URL)} pathstr @param {?number} length @return {nil}

Synchronous truncate
{@link https://nodejs.org/api/fs.html#fstruncatesyncpath-len}
@param {!(string|Buffer|URL)} pathstr
@param {?number} length
@return {nil}
raw docstring

(unlink pathstr)

Synchronously unlink a file. {@link https://nodejs.org/api/fs.html#fsunlinksyncpath} @param {!(string|Buffer|URL)} pathstr :: path of file to unlink @return {nil}

Synchronously unlink a file.
{@link https://nodejs.org/api/fs.html#fsunlinksyncpath}
@param {!(string|Buffer|URL)} pathstr :: path of file to unlink
@return {nil}
raw docstring

unwatchFilecljs

(unwatchFile pathstr)

remove all watchers from a file @param {!string} pathstr @return {nil}

remove all watchers from a file
@param {!string} pathstr
@return {nil}
raw docstring

utimescljs

(utimes pathstr atime mtime)

synchronous utimes Change the file system timestamps of the object referenced by path.

  • If the value is NaN or Infinity, the value would get converted to Date.now()
  • numerable strings ie '12235' are converted to numbers {@link https://nodejs.org/api/fs.html#fsutimessyncpath-atime-mtime} @param {!(string|Buffer|URL)} pathstr @param {(string|Number)} atime @param {(string|Number)} mtime @return {nil}
synchronous utimes
Change the file system timestamps of the object referenced by path.
- If the value is NaN or Infinity, the value would get converted to Date.now()
- numerable strings ie '12235' are converted to numbers
{@link https://nodejs.org/api/fs.html#fsutimessyncpath-atime-mtime}
@param {!(string|Buffer|URL)} pathstr
@param {(string|Number)} atime
@param {(string|Number)} mtime
@return {nil}
raw docstring

watchcljs

(watch filename)
(watch filename opts)

Watch a file or directory. Make note of caveats https://nodejs.org/api/fs.html#fs_caveats events : 'rename', 'change' , 'error', 'close' opts : :peristent {boolean} (true) :: whether the process should continue as long as files are being watched. :recursive {boolean} (false) :: watch subdirectories :buf-or-n {(impl/Buffer|number)} (10) :: channel buffer :encoding {string} ('utf8') :: used to interpret passed filename @return {!Watcher}

Watch a file or directory.
Make note of caveats https://nodejs.org/api/fs.html#fs_caveats
events : 'rename', 'change' , 'error', 'close'
opts :
 :peristent {boolean} (true) :: whether the process should continue as long as files are being watched.
 :recursive {boolean} (false) :: watch subdirectories
 :buf-or-n {(impl/Buffer|number)} (10) :: channel buffer
 :encoding {string} ('utf8') :: used to interpret passed filename
@return {!Watcher}
raw docstring

Watchercljs


watcher->chcljs

(watcher->ch FSWatcher out-ch)
(watcher->ch FSWatcher out-ch {:keys [key buf-or-n] :or {buf-or-n 10}})

watchFilecljs

(watchFile filename)
(watchFile filename opts)

Prefer watch. Polls files and returns stat objects. Opts: :peristent {boolean} (true) :: whether the process should continue as long as files are being watched. :interval {number} (5007) :: polling interval in msecs :buf-or-n {(impl/Buffer|number)} (10) :: channel buffer @return {!Channel} yielding [filename [current fs.stat, previous fs.stat]]

Prefer watch. Polls files and returns stat objects. Opts:
  :peristent {boolean} (true) :: whether the process should continue as long as files are being watched.
  :interval {number} (5007) :: polling interval in msecs
  :buf-or-n {(impl/Buffer|number)} (10) :: channel buffer
@return {!Channel} yielding [filename [current fs.stat, previous fs.stat]]
raw docstring

writable?cljs

(writable? pathstr)

Synchronously test if a file is writable to the process @param {!(string|Buffer|URL)} pathstr :: path to test for process write permission @return {!boolean}

Synchronously test if a file is writable to the process
@param {!(string|Buffer|URL)} pathstr :: path to test for process write permission
@return {!boolean}
raw docstring

writecljs

(write fd opts)
(write fd buffer opts)
(write fd buffer offset length position)

Synchronously write data from the buffer to the fd {@link https://nodejs.org/api/fs.html#fswritesyncfd-buffer-offset-length-position} Can pass arguments individually or as a map: :buffer (Buffer|ArrayBuffer) - data to be written :offset (Number) - where to start reading in the buffer :length (Number) - how many bytes to read :pos (Number|Bigint) - where to begin writing in the fd @return {!Number} number of bytes written

Synchronously write data from the buffer to the fd
{@link https://nodejs.org/api/fs.html#fswritesyncfd-buffer-offset-length-position}
Can pass arguments individually or as a map:
  :buffer (Buffer|ArrayBuffer) - data to be written
  :offset (Number) - where to start reading in the buffer
  :length (Number) - how many bytes to read
  :pos (Number|Bigint) - where to begin writing in the fd
@return {!Number} number of bytes written
raw docstring

write-filecljs

(write-file pathstr content opts)

synchronously writes content to file represented by pathstring. @param {!string} pathstr :: file to write to @param {(string|buffer.Buffer)} content :: if buffer, :encoding is ignored @param {?IMap} opts :: {:encoding {string}, :append {boolean}, :flags {string}, :mode {int}}

  • flags override append
  • :encoding defaults to utf8 @return {nil}
synchronously writes content to file represented by pathstring.
@param {!string} pathstr :: file to write to
@param {(string|buffer.Buffer)} content :: if buffer, :encoding is ignored
@param {?IMap} opts :: {:encoding {string}, :append {boolean}, :flags {string}, :mode {int}}
 - flags override append
 - :encoding defaults to utf8
@return {nil}
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close