1.1.3 • Published 5 years ago

@rentpath/hive-utils v1.1.3

Weekly downloads
65
License
MIT
Repository
-
Last release
5 years ago

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.

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago