@semo/core
    Preparing search index...

    Class Core

    Index

    Constructors

    Properties

    allPlugins: Record<string, string> = {}
    appConfig: Record<string, any> = {}
    combinedConfig: Record<string, any> = {}
    debugChannel: (channel: string, ...rest: unknown[]) => void
    debugCore: (...rest: unknown[]) => void
    debugCoreChannel: (channel: string, ...rest: unknown[]) => void
    initOptions: InitOptions = {}
    input: string = ''
    parsedArgv: ArgvExtraOptions = {}
    scriptName: string = ''
    version: string = ''

    Methods

    • Get current argv config

      Parameters

      • key: string = ''
      • defaultValue: unknown = undefined

      Returns string | Record<string, unknown>

    • convert pakcage.json to private, for internal use

      Parameters

      • packageJsonPath: string

        package.json file path

      Returns void

    • Parameters

      • command: string
      • moduleName: string
      • yargs: any
      • basePath: string

      Returns void

    • Get current node env setting

      You can change the node-env-key in command args or semo rc file

      Parameters

      • Optionalargv: Record<string, unknown>

      Returns string

    • Parameters

      • key: string
      • defaultValue: any = undefined
      • plugin: string = ''

      Returns any

    • Import a package on runtime

      If not exist, will install first,

      Parameters

      • name: string

        Package name

      • location: string = ''

        node_module directory by location

      • home: boolean = true

        if true save modules to .semo, if false, save to cwd

      • force: boolean = false

        Force install again

      Returns string

    • Parameters

      • name: string
      • location: string = ''
      • home: boolean = true
      • force: boolean = false

      Returns void

    • Load any package's package.json

      Parameters

      • pkg: string = undefined

        package name

      • paths: string[] = []

        search paths

      Returns Record<string, unknown>

    • Load plugin rc config

      Parameters

      • name: any

        Plugin name

      • location: string = ''

        plugin installed directory name under ~/.semo

      • home: boolean = true

        if load from HOME directory

      Returns Record<string, unknown>

    • Parameters

      • plugin: string
      • pluginPath: string

      Returns Record<string, unknown>

    • Parameters

      • name: string
      • location: string = ''
      • home: boolean = true

      Returns string

    • Parameters

      • name: string
      • location: string = ''
      • home: boolean = true

      Returns void

    • Use dotenv style

      Parameters

      • expand: true

        expand dotenv

      • _options: DotenvConfigOptions = {}

      Returns void

    • Parameters

      • command: any
      • _pathTofile: string
      • _filename: string

      Returns boolean

    • Project depends Semo has it's own Semo env which is not initialized. So we need to set the instance manually.

      Parameters

      • instance: Core

        Core instance

      Returns void