1.2.7 • Published 2 years ago

appdirsjs v1.2.7

Weekly downloads
3,819
License
MIT
Repository
github
Last release
2 years ago

appdirsjs

GitHub Workflow Status Codecov npm npm bundle size GitHub

A node.js library to get paths to directories to store configs, caches and data according to OS standarts.

Installation

npm install appdirsjs

or

yarn install appdirsjs

if you're using yarn.

Usage

import appDirs from "appdirsjs";

const dirs = appDirs({ appName: "expo" });

console.log(dirs.cache);
// /home/user/.cache/expo on Linux
// /Users/User/Library/Caches/expo on MacOS
// C:\Users\User\AppData\Local\Temp\expo on Windows

console.log(dirs.config);
// /home/user/.config/expo on Linux
// /Users/User/Library/Preferences/expo on MacOS
// C:\Users\User\AppData\Roaming\expo

console.log(dirs.data);
// /home/user/.local/share/expo on Linux
// /Users/User/Library/Application Support/expo on MacOS
// C:\Users\User\AppData\Local\expo

Keep backward compability

Then switching from old-style dotfile directory, such as ~/.myapp to new, like ~/.config/myapp, you can pass legacyPath parameter to keep using old directory if it exists:

import * as path from "path";
import appDirs from "appdirsjs";

const dirs = appDirs({
  appName: "expo",
  // Notice usage of full path
  legacyPath: path.join(os.homedir(), ".expo"),
});

console.log(dirs.config);
// /home/user/.expo

TODO

  • Android support
  • XDG on BSD support
easy-select-rnreact-native-custom-text-hwjamesreact-native-shekhar-bridge-testwilscanner@oiti/documentoscopy-react-nativequoc-testreact-native-slider-kf@unrevealed/cliluminos-ui-core@everything-registry/sub-chunk-1156jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgreact-native-jawwy_samplejrennsoh88-react-native-scroll-indicatorjordy-frijters-test-libheyrepo-cli@azure/web-pubsub-tunnel-tool@assystant/firebase@arctarus/architect@blusalt-sdk/react-native-blusalt-document-verification@brantalikp/rn-resize@aysea/react-native-ui-library@azalpacir/react-native-dhp-printer@baloochat/react-native-svg-uri@con-test/react-native-concent-common@cs6/react-native-test-native-view-library@damruravihara/react-native-testing-package@damian.lnc/core@enkeledi/react-native-week-month-date-picker@extrieve_technologies/quickcapture_react_native@exodus/react-native-community-cli-tools@glyw/react-native-tabbed-section-list@jfilipe-sparta/react-native-module_2@lehuyaa/my-assetsjawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwyreact-native-experts-sdktest_lib_module_aarkhaled-salem-custom-componentsnove-repositorynative-modal-damage-vehiclenative-date-picker-modulenew-awesome-4321pnm-yph-react-native-custom-componentsquickcapture_react_nativereact-native-custom-image-carouselreact-native-ctp-odpreact-native-dhp-printerreact-native-dimensions-layoutreact-native-dm-playerreact-native-firebase-messagingreact-native-expo-read-sms-ts-kfreact-native-expendable-viewreact-native-innity-2react-native-innity-remasterreact-native-input-libraryreact-native-ghn-ekycreact-native-get-countriesreact-native-fedlight-dsmreact-native-file-logger-forkedreact-native-android-scoped-storagereact-native-auth-service-clientreact-native-basic-appreact-native-basic-screenreact-native-additionreact-native-animate-textreact-native-android-video-player-viewreact-native-awesome-module-latestreact-native-aventonfacetec-aventonreact-native-awesome-android-123react-native-awesome-android-123-zeotapreact-native-bleccs-componentsreact-native-bluetooth-device-detectreact-native-build-vesion-getterreact-native-bridge-packagereact-native-chenaarreact-native-check-componentreact-native-conekta-card-tokenizerreact-native-components-designrn-agora-ios-mreat-native-multiplierkprreact_native_pandey_marqueereactnativelyreact-native-rabbitmq-allreact-native-radio-bic-group-libreact-native-remote-cloverreact-native-return-usb-datareact-native-responsive-helperreact-native-priya-demo-buttonreact-native-reanimated-sortable-listreact-native-recent-framework-updatereact-native-scroll-tab-to-indexreact-native-rn-appreact-native-rn-icons-library
1.2.7

2 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.2.1

4 years ago

1.0.0

4 years ago

undefined

10 years ago