Skip to content

Latest commit

 

History

History
127 lines (87 loc) · 4.89 KB

api.md

File metadata and controls

127 lines (87 loc) · 4.89 KB

Modules

basd/lib/basd-node

This file contains extensions to lodash that require the Node.js environment. This includes functions for managing directories, retrieving files from URLs, writing data to files, and more.

basd/lib/basd

This file contains extensions to lodash for a more enhanced usage. This includes functions for data hashing, generating UUIDs, and more. It should be used in browser environments.

basd/lib/basd-node

This file contains extensions to lodash that require the Node.js environment. This includes functions for managing directories, retrieving files from URLs, writing data to files, and more.

basd/lib/basd-node~mkdir ⇒ string

Makes a directory at the given path.

Kind: inner constant of basd/lib/basd-node
Returns: string - The path of the created directory.
Throws:

  • Error If an error other than "EEXIST" occurs.
Param Type Description
dirpath string The path where to create the directory.

basd/lib/basd-node~rmdir ⇒ string

Recursively removes a directory at the given path.

Kind: inner constant of basd/lib/basd-node
Returns: string - The path of the removed directory.

Param Type Description
dirpath string The path of the directory to remove.

basd/lib/basd-node~getFile ⇒ Promise.<Buffer>

Retrieves a file from a URL.

Kind: inner constant of basd/lib/basd-node
Returns: Promise.<Buffer> - A promise that resolves with the file data.

Param Type Default Description
[url] string "'https://i.imgur.com/SHo6Fub.jpeg&#x27;" The URL of the file to retrieve.
axios Axios The Axios instance to use for the HTTP request.

basd/lib/basd-node~putFile

Writes data to a file.

Kind: inner constant of basd/lib/basd-node
Throws:

  • Error If an error occurs during writing.
Param Type Description
buff Buffer The data to write to the file.
[path] string The path of the file. If not specified, it defaults to 'based-1.png' in the current directory.

basd/lib/basd

This file contains extensions to lodash for a more enhanced usage. This includes functions for data hashing, generating UUIDs, and more. It should be used in browser environments.

basd/lib/basd~hash ⇒ Buffer | string

Hashes the given data.

Kind: inner constant of basd/lib/basd
Returns: Buffer | string - The hashed output.
Throws:

  • Error If data is nil.
Param Type Default Description
data any The data to hash.
[length] number BYTE_LENGTH The length of the hashed output.
[encode] boolean | string true Whether to encode the output. If a string is passed, it specifies the type of encoding ('hex' is currently supported).

basd/lib/basd~uuid ⇒ string

Generates a universally unique identifier.

Kind: inner constant of basd/lib/basd
Returns: string - The generated UUID.

Param Type Default Description
[bytes] number 12 The number of random bytes to generate.
[prefix] string "''" The prefix to prepend to the UUID.