Module
Node.Library.EnvPaths
- Package
- purescript-node-env-paths
- Repository
- jordanmartinez/purescript-node-env-paths
Constructs the platform-independent file paths for commonly used storage places.
These paths may not exist on the computer, so calls to mkdir -p
may be necessary.
#EnvPathsContext Source
newtype EnvPathsContext
Context needed to accurately produce an EnvPaths
value.
#envPaths Source
envPaths :: { ctx :: EnvPathsContext, name :: String, suffix :: Maybe String } -> EnvPaths
Gets the paths based on information obtained previously sometime in the past. Since these values rarely change, the below example should be safe for most usages.
foo = do
ctx <- envPathsContext
-- if user changes an environment value after this call
-- then `paths` below will provide out-of-date information.
let paths = envPaths' ctx { name: "foo", suffix: Nothing }
The suffix
arg defaults to -nodejs
to prevent name conflicts with native apps.
- Modules
- Node.
Library. EnvPaths