Quark #

Modules #

Quark v1.2.0 Documentation


quark/pkg #

getOrigin(from) #

http://google.com/aa/test.txt => http://google.com
zip:///home/xxx/test.apk@/assets/bb.jpg => zip:///home/xxx/test.apk@
file:///d:/a/bc/d/e/f/test.txt => file://d:
file:///a/bc/d/e/f/test.txt => file://

Interface: PackageJson #

PackageJson #

packagejson.name #

packagejson.main #

packagejson.version #

packagejson.description? #

packagejson.scripts? #

packagejson.author? #

packagejson.keywords? #

packagejson.license? #

packagejson.bugs? #

packagejson.homepage? #

packagejson.devDependencies? #

  • devDependencies?: Dict<string>

packagejson.dependencies? #

packagejson.bin? #

packagejson.hash? #

packagejson.pkgzHash? #

packagejson.id? #

packagejson.app? #

packagejson.tryLocal? #

  • symlink?: string package path symlink

packagejson.pkgzSize? #

  • pkgzSize?: number pkgz file size

packagejson.modules? #

packagejson.load(noCache?) #

load packages name and version and files hash

packagejson.loadSync() #

async load packages name and version and files hash

Class: Module #

Module #

  • @implements IModule

module.id #

module.exports #

  • @get exports: any

module.parent #

module.package #

module.filename #

  • @get filename: string filename

module.dirname #

  • @get dirname: string dirname

module.loaded #

module.children #

module.paths #

  • @get paths: string[] search paths

module.require(path) #

Request module by the path

  • @param path: string
  • @return any

Class: Package #

Package #

package.json #

package json information

package.name #

package name

package.tryLocal #

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

package.path #

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

package.hash #

package hash

package.pkgzHash #

pkgz hash

package.filesHash #

version information of files in the package

  • @get filesHash: Dict<string>

package.build #

is build

package.isHttp #

is http path

package.isInternal #

is internal package

package.resolve(relativePath) #

Lookup internal module by the relative path

  • @param relativePath: string
  • @return any

package.install() #

Async install package

  • @return Promise<void>

package.installSync() #

Sync install package

Class: QkPackage #

QkPackage #

qk://quark ExtendModule Internal expansion module

default #

default.mainPackage #

default.mainModule #

default.mainFilename #

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

Add global search path

  • @param path: string global search directory path
  • @param isFirst?: boolean use high priority
  • @param noCache?: boolean use __no_cache param load pkgs.json file
  • @return Promise<void>

default.lookupPackage(name,parent?) #

Lookup package by package name