Module: @lumjs/core/modules

Module helpers.

Source:

Methods

(static) name(module, optsopt) → {string}

Get the name of a module.

Parameters:
Name Type Attributes Description
module object | string

Either a module object, or filename. If it is an object, it should be a CommonJS module object. If it is a string, it should be the module filename.

opts object <optional>

Options.

Properties
Name Type Attributes Default Description
useAuto boolean <optional>
true

Enable automatic name cleaning. If basename mode was not used, then once all other rules have been applied, strip any leading . and / characters, and the file extension.

basename boolean <optional>
false

Use path.basename() This will strip all parent directories, and the file extension. If no other rules are specified in the opts, then this will be applied automatically as a fallback method. If it is set to true explicitly, then it will be applied before any other options.

replace object <optional>

Call module:@lumjs/core/strings.replaceItems This uses the default useAll values based on the object format.

replaceOne object <optional>

replace but useAll set to false.

replaceAll object <optional>

replace but useAll set to true.

strip string | Array.<string> <optional>

Sub-strings to remove entirely.

Source:
Returns:

The name of a module as per the options set.

Type
string