Quark #

Modules #

Quark v1.4.0 Documentation

Contents

quark/pkg #

Interface: PackageJson #

PackageJson #

packagejson.name #

name: string

packagejson.main #

main: string

packagejson.version #

version: string

packagejson.description? #

description?: string

packagejson.scripts? #

scripts?: Dict<string>

packagejson.author? #

author?: Dict<string>

packagejson.keywords? #

keywords?: string[]

packagejson.license? #

license?: string

packagejson.bugs? #

bugs?: Dict<string>

packagejson.homepage? #

homepage?: string

packagejson.devDependencies? #

devDependencies?: Dict<string>

packagejson.dependencies? #

dependencies?: Dict<string>

packagejson.bin? #

bin?: string

packagejson.hash? #

hash?: string

packagejson.pkgzHash? #

pkgzHash?: string

packagejson.id? #

id?: string

packagejson.app? #

app?: string

packagejson.tryLocal? #

tryLocal?: boolean

package path symlink

symlink?: string

packagejson.pkgzSize? #

pkgz file size

pkgzSize?: number

packagejson.modules? #

modules?: Dict<Dict<PackageJson>>

packagejson.watching? #

having debug server of the watching mode

watching?: boolean

Class: Module #

Module #

Implements: IModule

module.id #

readonly id: string

module.exports #

readonly exports: any

module.parent #

readonly parent: Module | null

module.package #

readonly package: Package | null

module.filename #

filename

readonly filename: string

module.dirname #

dirname

readonly dirname: string

module.loaded #

readonly loaded: boolean

module.children #

readonly children: Module[]

module.paths #

search paths

readonly paths: string[]

module.require(path) #

Request module by the path

require(path: string): any

Class: Package #

Package #

package.json #

package json information

readonly json: PackageJson

package.name #

package name

readonly name: string

package.tryLocal #

Did you attempt to use a local reference package when an error occurred while downloading and installing the network package

readonly tryLocal: boolean

package.path #

package path, zip:///applications/test.apk@, qk://quark, file:///node_modules/xxxx

readonly path: string

package.hash #

package hash

readonly hash: string

package.pkgzHash #

pkgz hash

readonly pkgzHash: string

package.filesHash #

version information of files in the package

readonly filesHash: Dict<string>

package.build #

is build

readonly build: boolean

package.isHttp #

is http path

readonly isHttp: boolean

package.isInternal #

is internal package

readonly isInternal: boolean

package.resolve(relativePath) #

Lookup internal module by the relative path

resolve(relativePath: string): any

package.install() #

Async install package

install(): Promise<void>

package.installSync() #

Sync install package

installSync()

default #

default.onFileChanged #

  • @event onFileChanged:

Trigger when a typescrip or javascript file is modified.

default.isWatching #

readonly isWatching: boolean

default.mainPackage #

readonly mainPackage: Package

default.mainModule #

readonly mainModule: Module

default.mainFilename #

readonly mainFilename: string

default.addSearchPath(path,isFirst?,noCache?) #

Add global search path

addSearchPath(path: string, isFirst?: boolean, noCache?: boolean): Promise<void>

Parameters:

  • path — global search directory path
  • isFirst? — use high priority
  • noCache? — use __no_cache param load pkgs.json file

default.lookupPackage(name,parent?) #

Lookup package by package name

lookupPackage(name: string, parent?: Module): Package | null