New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@hoast/base-package

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hoast/base-package

Base package for other packages.

latest
Source
npmnpm
Version
3.1.0
Version published
Maintainers
1
Created
Source

@hoast/base-package

Provides basic functionality like receiving the library's reference and setting up a logger. Meant for developers to be used as a base for a hoast source or process package.

Install

npm install @hoast/base-package

Usage

Constructor

  • constructor Create package instance.
    • @param {Object} ...Options Options objects which can contain the following key.
      • {Number} logLevel = 2 Log level given to the logger.

Functions

  • getOptions Get merged options.
    • @returns {Object} options.
  • getLibrary Get the hoast instance that the module is part of.
    • @returns {Hoast} hoast instance.
  • setLibrary Set library reference. This will be called by hoast itself before the next function is called.
    • @params {Hoast} library hoast instance.
  • getLogger Get the logger instance.
    • @returns {Logger} logger instance.

Example

// Import base modules.
import BasePackage from '@hoast/base-package'

class NewPackage extends BasePackage {
  constructor(options) {
    super({
      // Default options.
    }, options)
  }
}

export default NewPackage

See the @hoast/process-log package for another example.

Keywords

hoast

FAQs

Package last updated on 11 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts