🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

system-folders

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

system-folders

Get common folders in a unified way.

latest
Source
npmnpm
Version
1.0.114
Version published
Weekly downloads
4
300%
Maintainers
1
Weekly downloads
 
Created
Source

#system-folders

Result with standard folders appropriate by system.

A Note on extending paths... many people have a misconception that backslash ('\') is the only valid path character on windows. This is not true; instead windows accepts internall either forward-slash ('/') or backslash('\') as equivalent path separators. The only exception to this is when specifying a path that is on a remote computer share, in which case backslash('\') must be used as in '\\computer\share' but after that point forward slashses may be used. On all linux systems only '/' is valid.

Please leave issues on github for feature requests/fixes, questions, comments or criticisms. Or Gitter

##Usage

const systemFolders = require( '.' );
systemFolders( "myAppName" ); // configure paths to include my application's name

System Folders result Object fields

DirectoryDescription
homeCurrent users home directory
appDatawhere common application local data should be stored
documentscurrent user's document directory
downloadscurrent user's download directory
tempwhere to put temporary files

Win32 example output (without app name configured):

{
  home: C:\\Users\\Youzer,
  appData: 'C:\\Users\\Youzer\\AppData\\Local',
  documents: 'C:\\Users\\Youzer\\Documents',
  download: 'C:\\Users\\Youzer\\Downloads',
  temp: 'C:\\Users\\Youzer\\AppData\\Local\\Temp' 
}

Win32 example output (app name configured):

{
  home: C:\\Users\\Youzer,
  appData: 'C:\\Users\\Youzer\\AppData\\Local\\myAppName',
  documents: 'C:\\Users\\Youzer\\Documents\\myAppName',
  download: 'C:\\Users\\Youzer\\Downloads',
  temp: 'C:\\Users\\Youzer\\AppData\\Local\\Temp\\myAppName' 
}

Keywords

system-directories

FAQs

Package last updated on 29 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts