Quark #

Modules #

Quark v1.2.0 Documentation


quark/_util #

normalizePath(path,retain_up?) #

format part

formatPath(...args) #

file:///home/louis/test.txt
file:///d:/home/louis/test.txt
http://google.com/test.txt
return format path

isAbsolute(path) #

Is it an absolute path?

isLocal(path) #

Is it a local path?

isLocalZip(path) #

isHttp(path) #

stripBOM(content) #

Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
because the buffer-to-string conversion in fs.readFileSync()
translates it to FEFF, the UTF-16 BOM.

stripShebang(content) #

Find end of shebang line and slice it off

assert(value,message?) #

  • @param value: any
  • @param message?: string

Class: Hash5381 #

Hash5381 #

hash5381.hashCode() #

hash5381.update(data) #

hash5381.digest() #

hash5381.clear() #

Platform #

  • @type Platform = "darwin"|"android"|"linux"|"win32"

default #

default.debug #

default.version()string #

Get quark framework version

default.platform #

default.argv #

default.options #

default.nextTick(cb) #

Wait for the next tick of the message loop to call the callback function

default.sleep(time) #

Asynchronous sleep, equivalent to calling setTimeout

default.gc() #

Manually let the JavaScript engine perform GC actions

default.runScript(source,name?,sandbox?) #

Compile and run a piece of javascript code and return the running result.
You can specify a name and a running context object.

The name is very useful when debugging code or program exceptions. It is usually a file name.

If you do not pass this sandbox sandbox context, the default is to use the global object.

  • @param source: string javascript source code
  • @param name?: string
  • @param sandbox?: object
  • @return any

default.hashCode(obj) #

Read the hash value of a data object

  • @param obj: any
  • @return Int

default.hash(obj) #

Read the hash value of a data object, and convert the value to a string

  • @param obj: any
  • @return string