temp service

Helps configure and manage a temporary folder for Tymly to use. This service is provided via the tymly plugin and isn't offered by any of the other core plugins.

Boot config

  "tempDir": "/some/dir/somewhere"
Property Type Description Required
tempDir string A path pointing to a directory to use as an alternative to the system-allocated temp dir No

Service methods/properties


This is the value as derived by first considering if a tempDir value is specified in the config, failing that if a $TYMLY_TEMPDIR environment variable has been set… and if all else fails use the system temp dir (i.e. the value returned by os.tmpdir())


  • tempDir string The root of Tymly’s temporary directory


console.log(temp.tempDir) // /some/absolute/dir


Makes a new temporary directory using mkdirp


  • subDirPath string A sub dir to create relative to temp.tempDir
  • callback Function called with the absolute path to the dir that was created


  function (err, fullPath) {
    // Where fullPath would be something absolute, e.g:
    //   /temp/dir/some/subDir

Returns undefined