| name | stacks-path |
| description | Use when working with file paths in Stacks — 100+ framework-aware path builder functions for every directory in the project (actions, app, config, database, models, routes, storage, etc.), plus Node.js path utilities (join, resolve, basename, dirname, etc.). Covers @stacksjs/path. |
| license | MIT |
| compatibility | Bun >= 1.3.0, TypeScript |
| allowed-tools | Read Edit Write Bash Grep Glob |
Stacks Path
100+ path builder functions for every framework directory.
Key Path
- Core package:
storage/framework/core/path/src/
Node.js Path Re-exports
basename, delimiter, dirname, extname, isAbsolute, join, normalize, parse, relative, resolve, sep, toNamespacedPath
Framework Path Builders
All accept an optional relative path suffix and return absolute paths.
Application Paths
appPath('Models')
userActionsPath()
userComponentsPath()
userViewsPath()
userFunctionsPath()
userJobsPath()
userControllersPath()
userListenersPath()
userMiddlewarePath()
userModelsPath()
userNotificationsPath()
userDatabasePath()
userMigrationsPath()
userEventsPath()
Framework Paths
actionsPath()
buddyPath()
runtimePath()
buildPath()
cachePath()
cloudPath()
frameworkCloudPath()
libsPath()
Package Paths (one per core package)
aiPath() analyticsPath() aliasPath()
arraysPath() authPath() browserPath()
cliPath() chatPath() collectionsPath()
configPath() databasePath() datetimePath()
dnsPath() docsPath() emailPath()
enumsPath() envPath() errorHandlingPath()
eventsPath() fakerPath() gitPath()
healthPath() httpPath() i18nPath()
lintPath() loggingPath() notificationsPath()
objectsPath() ormPath() pathPath()
paymentsPath() pluginsPath() pushPath()
queuePath() realtimePath() routerPath()
schedulerPath() searchEnginePath() securityPath()
serverPath() shellPath() slugPath()
smsPath() socialsPath() ()
() () ()
() () ()
() () ()
Resource Paths
assetsPath()
resourcesPath()
publicPath()
localesPath()
routesPath()
Build & Output Paths
buildEnginePath()
libsEntriesPath()
frameworkPath()
corePath()
defaultsPath()
defaultsAppPath()
defaultsResourcesPath()
Relative Path Variants
Most paths have relative* variants:
relativeActionsPath()
relativeAppPath()
Path with Suffix
appPath('Models/User.ts')
databasePath('migrations')
configPath('app.ts')
Gotchas
- Always use
@stacksjs/path instead of Node's path for framework paths
- All paths resolve to absolute paths by default
- Most functions accept an optional relative path suffix
relative* variants return paths relative to project root
user*Path() functions point to application-level directories (app/)
built*Path() functions point to compiled output directories
- Path is a dependency of almost every framework package
- Some paths accept
options with relative flag