(acopy input output & opts)
Copies input to output via streams asynchronously.
Copies input to output via streams asynchronously. + Unlike JVM, strings interpreted as filespaths + Options are passed to the output stream. @param {(string, File, Buffer, Readable)} input @param {(string, File, Buffer, Readable)} output @return {!Channel} yielding [?err]
(as-relative-path x)
a relative path, else IllegalArgumentException. @param {(string|IFile|Uri)} x @return {!string}
a relative path, else IllegalArgumentException. @param {(string|IFile|Uri)} x @return {!string}
(aslurp p & opts)
@return {!Channel} a which will receive [?err ?data]
@return {!Channel} a which will receive [?err ?data]
(aspit p content & options)
Async spit. Wait for result before writing again! @param {(string|IFile|Uri)} p :: path to write to @param {(string|buffer.Buffer)} content to write Options: :encoding {string} defaults to utf8. Ignored when content is a buffer :append {bool} - add content to end of existing file. :flags {string} - overrides :append when set :mode {number} - set on newly created files @return {!Channel} recieves [?err]
Async spit. Wait for result before writing again! @param {(string|IFile|Uri)} p :: path to write to @param {(string|buffer.Buffer)} content to write Options: :encoding {string} defaults to utf8. Ignored when content is a buffer :append {bool} - add content to end of existing file. :flags {string} - overrides :append when set :mode {number} - set on newly created files @return {!Channel} recieves [?err]
(Buffer? b)
sugar over Buffer.isBuffer @param {*} b @return {!boolean}
sugar over Buffer.isBuffer @param {*} b @return {!boolean}
(as-file x)
Coerce argument to a file.
Coerce argument to a file.
(as-url x)
Coerce argument to a URL.
Coerce argument to a URL.
(copy input output & opts)
Synchronously copies input to output.. Only supports files and strings/buffers as filepaths @param {(string, File, Buffer)} input @param {(string, File, Buffer)} output @return {nil} throws on error
Synchronously copies input to output.. Only supports files and strings/buffers as filepaths @param {(string, File, Buffer)} input @param {(string, File, Buffer)} output @return {nil} throws on error
(delete-file f & [silently])
Delete file f. Raise an exception if it fails unless silently is true. @return {!boolean}
Delete file f. Raise an exception if it fails unless silently is true. @return {!boolean}
(file arg)
(file parent child)
(file parent child & more)
Returns a reified file, passing each arg to as-file. Multiple-arg versions treat the first argument as parent and subsequent args as children relative to the parent. Use in place of File constructor @return {!IFile}
Returns a reified file, passing each arg to as-file. Multiple-arg versions treat the first argument as parent and subsequent args as children relative to the parent. Use in place of File constructor @return {!IFile}
(file-seq dir)
A tree seq on cljs-node-io.Files @return {LazySeq<File>}
A tree seq on cljs-node-io.Files @return {LazySeq<File>}
(filepath a)
(filepath a b)
This is needed to mock the java.io.File constructor. The java File constructor is polymorphic and accepts one or two args: (Uri), (pathstring), (parentstring, childstring), (File, childstring) @return {!string}
This is needed to mock the java.io.File constructor. The java File constructor is polymorphic and accepts one or two args: (Uri), (pathstring), (parentstring, childstring), (File, childstring) @return {!string}
(input-stream x & opts)
Attempt to create a native stream.Readable. {@link https://nodejs.org/api/stream.html#class-streamreadable} Note that node streams are event driven.
Attempt to create a native stream.Readable. {@link https://nodejs.org/api/stream.html#class-streamreadable} Note that node streams are event driven. + stream.Readable => itself + buffers => stream.Readable + files + strings + goog.Uri => fs.ReadStream @return {!stream.Readable}
Attempts to create a native node stream.
Attempts to create a native node stream.
(make-input-stream x opts)
create stream.Readable
create stream.Readable
(make-output-stream x opts)
create stream.Writable
create stream.Writable
(make-reader x opts)
create stream.Readable
create stream.Readable
(make-writer x opts)
create stream.Writable
create stream.Writable
(make-parents f & more)
Given the same arg(s) as for file, creates all parent directories of the file they represent. @return {!boolean}
Given the same arg(s) as for file, creates all parent directories of the file they represent. @return {!boolean}
(output-stream x & opts)
Attempt to create a native stream.Writable. {@link https://nodejs.org/api/stream.html#class-streamwritable} Note that node streams are event driven.
Attempt to create a native stream.Writable. {@link https://nodejs.org/api/stream.html#class-streamwritable} Note that node streams are event driven. + stream.Writable => itself + buffers => stream.Writable + files + strings + goog.Uri => fs.WriteStream @return {!stream.Writable}
(readable obj)
(readable obj opts)
Tries to create a stream.Readable from obj. Supports iterables & array-likes in addition to those types supported by IOFactory {@link https://nodejs.org/api/stream.html#class-streamreadable} @param {*} obj @return {!stream.Readable}
Tries to create a stream.Readable from obj. Supports iterables & array-likes in addition to those types supported by IOFactory {@link https://nodejs.org/api/stream.html#class-streamreadable} @param {*} obj @return {!stream.Readable}
(reader x & opts)
Attempt to create a native stream.Readable. {@link https://nodejs.org/api/stream.html#class-streamreadable} Note that node streams are event driven.
Attempt to create a native stream.Readable. {@link https://nodejs.org/api/stream.html#class-streamreadable} Note that node streams are event driven. + stream.Readable => itself + buffers => stream.Readable + files + strings + goog.Uri => fs.ReadStream @return {!stream.Readable}
(slurp p & opts)
Returns a string synchronously. Unlike JVM, does not use FileInputStream. Only option at this time is :encoding If :encoding "" (an explicit empty string), returns raw buffer instead of string. @return {(string|buffer.Buffer)}
Returns a string synchronously. Unlike JVM, does not use FileInputStream. Only option at this time is :encoding If :encoding "" (an explicit empty string), returns raw buffer instead of string. @return {(string|buffer.Buffer)}
(spit p content & options)
Writes content synchronously to file f. @param {(string|IFile|Uri)} p :: path to write to @param {(string|buffer.Buffer)} content to write Options: :encoding {string} defaults to utf8. Ignored when content is a buffer :append {bool} - add content to end of existing file. :flags {string} - overrides :append when set :mode {number} - set on newly created files @return {nil} or throws
Writes content synchronously to file f. @param {(string|IFile|Uri)} p :: path to write to @param {(string|buffer.Buffer)} content to write Options: :encoding {string} defaults to utf8. Ignored when content is a buffer :append {bool} - add content to end of existing file. :flags {string} - overrides :append when set :mode {number} - set on newly created files @return {nil} or throws
(writable obj)
(writable obj opts)
Tries to create a stream.Writable from obj @param {*} obj @return {!stream.Writable}
Tries to create a stream.Writable from obj @param {*} obj @return {!stream.Writable}
(writer x & opts)
Attempt to create a native stream.Writable. {@link https://nodejs.org/api/stream.html#class-streamwritable} Note that node streams are event driven.
Attempt to create a native stream.Writable. {@link https://nodejs.org/api/stream.html#class-streamwritable} Note that node streams are event driven. + stream.Writable => itself + buffers => stream.Writable + files + strings + goog.Uri => fs.WriteStream @return {!stream.Writable}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close