🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@rentpath/hive-utils

Package Overview
Dependencies
Maintainers
11
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rentpath/hive-utils

Utility methods/classes

latest
npmnpm
Version
1.1.3
Version published
Maintainers
11
Created
Source

hive-utils

Utility methods/classes

makeDir(dir, [options])

Promisified version of mkdirp.

readFile(file, [options])

Promisified of of fs.readFile.

writeFile(file, data, [options])

Promisified version of fs.writeFile.

interpolateName(name, options)

A simplified version of webpack's interpolateName loader utility method.

  • name (String): The filename template. The following tokens are available:
    • [ext] the resource extension
    • [name] the resource basename
    • [path] the resource path, relative to the context option
    • [folder] the directory the resource is in
    • [hash] a md5 hash of either options.content or options.resource
  • options (Object): A configuration object supporting the following options:
    • resource (String): The relative file path of a resource.
    • context (String): An absolute directory path that template tokens are resolved relative to (optional).
    • content (String): If provided, is used as source content when generating a hash token (optional).

Env

A collection of methods for interacting with environment variables.

Env.load(paths, [options])

A light wrapper around dotenv.config for loading environment variables.

  • paths (String|Array) A single environment file path, or an array of paths.
  • options (Object) Configuration options passed to dotenv.config.

Env.get(key, [default])

  • key (String) The environment variable name.
  • default (String) A default if the value is undefined. Reads environment variables from process.env.

Env.set(key, value)

  • key (String) The environment variable name.
  • value (String) The environment variable value. Writes environment variables to process.env.

Log

A collection of methods that wrap chalk for printing console messages.

Log.print(message, [color])

Logs a message to the console with a given color (defaults to white).

Log.info(message)

Logs a info message using blue color.

Log.warn(message)

Logs a warning message using orange color.

Log.success(message)

Logs a success message using green color.

Log.error(message)

Logs a error message using red color.

FAQs

Package last updated on 12 Jun 2019

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