JavaScript-QuickJS

 view release on metacpan or  search on metacpan

quickjs/doc/quickjs.texi  view on Meta::CPAN

@code{fdopen()}). Return the FILE
object or @code{null} in case of I/O error. If @code{errorObj} is not
undefined, set its @code{errno} property to the error code or to 0 if
no error occured.

@item tmpfile(errorObj = undefined)
Open a temporary file. Return the FILE
object or @code{null} in case of I/O error. If @code{errorObj} is not
undefined, set its @code{errno} property to the error code or to 0 if
no error occured.

@item puts(str)
Equivalent to @code{std.out.puts(str)}.

@item printf(fmt, ...args)
Equivalent to @code{std.out.printf(fmt, ...args)}.

@item sprintf(fmt, ...args)
Equivalent to the libc sprintf().

@item in
@item out
@item err
Wrappers to the libc file @code{stdin}, @code{stdout}, @code{stderr}.

@item SEEK_SET
@item SEEK_CUR
@item SEEK_END
Constants for seek().

@item Error

Enumeration object containing the integer value of common errors
(additional error codes may be defined):

  @table @code
  @item EINVAL
  @item EIO
  @item EACCES
  @item EEXIST
  @item ENOSPC
  @item ENOSYS
  @item EBUSY
  @item ENOENT
  @item EPERM
  @item EPIPE
  @end table

@item strerror(errno)
Return a string that describes the error @code{errno}.

@item gc()
Manually invoke the cycle removal algorithm. The cycle removal
algorithm is automatically started when needed, so this function is
useful in case of specific memory constraints or for testing.

@item getenv(name)
Return the value of the environment variable @code{name} or
@code{undefined} if it is not defined.

@item setenv(name, value)
Set the value of the environment variable @code{name} to the string
@code{value}.

@item unsetenv(name)
Delete the environment variable @code{name}.

@item getenviron()
Return an object containing the environment variables as key-value pairs.

@item urlGet(url, options = undefined)

Download @code{url} using the @file{curl} command line
utility. @code{options} is an optional object containing the following
optional properties:

  @table @code
  @item binary
  Boolean (default = false). If true, the response is an ArrayBuffer
  instead of a string. When a string is returned, the data is assumed
  to be UTF-8 encoded.

  @item full
  
  Boolean (default = false). If true, return the an object contains
  the properties @code{response} (response content),
  @code{responseHeaders} (headers separated by CRLF), @code{status}
  (status code). @code{response} is @code{null} is case of protocol or
  network error. If @code{full} is false, only the response is
  returned if the status is between 200 and 299. Otherwise @code{null}
  is returned.

  @end table

@item parseExtJSON(str)

  Parse @code{str} using a superset of @code{JSON.parse}. The
  following extensions are accepted:

  @itemize
  @item Single line and multiline comments
  @item unquoted properties (ASCII-only Javascript identifiers)
  @item trailing comma in array and object definitions
  @item single quoted strings
  @item @code{\f} and @code{\v} are accepted as space characters
  @item leading plus in numbers
  @item octal (@code{0o} prefix) and hexadecimal (@code{0x} prefix) numbers
  @end itemize
@end table

FILE prototype:

@table @code
@item close()
Close the file. Return 0 if OK or @code{-errno} in case of I/O error.
@item puts(str)
Outputs the string with the UTF-8 encoding.
@item printf(fmt, ...args)
Formatted printf.

The same formats as the standard C library @code{printf} are
supported. Integer format types (e.g. @code{%d}) truncate the Numbers
or BigInts to 32 bits. Use the @code{l} modifier (e.g. @code{%ld}) to
truncate to 64 bits.



( run in 0.486 second using v1.01-cache-2.11-cpan-70e19b8f4f1 )