Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ospath

jprichardson20.8mMIT1.2.2TypeScript support: definitely-typed

Operating system specific paths.

home, data, dir, directory, path, tmp, temp, windows, linux, darwin, mac

readme

ospath

npm Package build status

A JavaScript component that provides operating specific path values.

Installation

npm i --save ospath

API

ospath.data()

Returns the directory where an application should store its data directory.

  • Windows: %APPDATA%
  • OS X: ~/Library/Application Support
  • Unix-like: $XDG_CONFIG_HOME or ~/.config

ospath.desktop()

Returns the users desktop directory. On every OS, this is just the home() dir and Desktop.

ospath.home()

Returns the user's home directory.

  • Windows: %USERPROFILE%
  • Unix-like: $HOME

ospath.tmp()

Returns a temporary directory. Could also use require('os').tmpdir().

  • Windows: %TEMP%
  • Unix-like: /tmp

License

MIT

changelog

1.2.2 / 2016-09-06

  • fix files field

1.2.0 / 2016-09-06

  • upgrade to Standard@v8
  • fix tests
  • added desktop() function

1.1.0 / 2015-06-17

  • if os.homedir() is available, use it for home()

1.0.2 / 2015-06-16

  • fixed bad files field in package.json

1.0.1 / 2015-06-16

  • only include specific files

1.0.0 / 2015-06-16

  • initial release