Skip to main content

bud.path

You can use bud.path to reference a file or directory's absolute path.

Usage

bud.path('./src/scripts/components')

You may also choose to deliniate directories with an Array of path segments, rather than a String:

bud.path('./src', 'scripts', 'components')

Special path handles

The following is a table containing string values which fulfill a special role in the context of the bud.path function:

handledescriptiondefault
@srcsource directory./src
@distdestination directory./dist
@storagecache/artifact storage directory./.budfiles
@modulesmodules directory./node_modules
note

The @storage path is used to store cache and artifact files. It should not be set with bud.setPath. There is a lot of logic that depends on this path being set and much of it executes before any user configuration files are loaded.

If you want to customize the storage path, you should use the --storage flag instead.

When one of these handles is used at the beginning of a string path (or the first segment in a multi-segment path), the path will be prefixed with the corresponding directory.

For example, to reference the ./src directory:

bud.path('@src/scripts/components')

You can create your own handles for use in the bud.path function. But, the handles in this table are standard. Other parts of bud.js or its ecosystem may use these handles to reference project directories. So, while they may be freely modified as needed, they should not be removed or repurposed.

System path handles

These handles should be considered read-only.

handledescription
@os-cacheabsolute path to project folder in os cache directory
@os-tempabsolute path to project folder in os tempfiles directory
@os-dataabsolute path to project folder in os data directory
@os-logabsolute path to project folder in os log directory
@os-configabsolute path to project folder in os config directory