1.0.3 • Published 5 years ago

homedir-polyfill v1.0.3

Weekly downloads
7,524,286
License
MIT
Repository
github
Last release
5 years ago

homedir-polyfill NPM version NPM monthly downloads NPM total downloads Linux Build Status Windows Build Status

Node.js os.homedir polyfill for older versions of node.js.

Please consider following this project's author, Brian Woodward, and consider starring the project to show your :heart: and support.

Install

Install with npm:

$ npm install --save homedir-polyfill

Usage

var homedir = require('homedir-polyfill');
console.log(homedir());
//=> /Users/doowb

Reasoning

This library is a polyfill for the node.js os.homedir method found in modern versions of node.js.

This implementation tries to follow the implementation found in libuv by finding the current user using the process.geteuid() method and the /etc/passwd file. This should usually work in a linux environment, but will also fallback to looking at user specific environment variables to build the user's home directory if neccessary.

Since /etc/passwd is not available on windows platforms, this implementation will use environment variables to find the home directory.

In modern versions of node.js, os.homedir is used.

About

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Please read the contributing guide for advice on opening issues, pull requests, and coding standards.

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Related projects

You might also be interested in these projects:

parse-passwd: Parse a passwd file into a list of users. | homepage

Contributors

CommitsContributor
19doowb
2martinheidegger

Author

Brian Woodward

License

Copyright © 2016 - 2019, Brian Woodward. Released under the MIT License.


This file was generated by verb-generate-readme, v0.8.0, on February 21, 2019.

expand-tildearchetype-library@steven-torres/jsxr@l1nyanm1ng/react-picture-viewerunblock-block-save-variables@infinitebrahmanuniverse/nolb-homed@everything-registry/sub-chunk-1858gogency-test-2gogencyjeuxuimpesa-cookiempesa-cookie-jarm2m-chartjs-plugin-crosshairmiguelcostero-ng2-toastynois-react-toastn8n-nodes-caldav@udooku/react-image-comparison-slider@tillschweneker/ckeditor5-build-strapi-wysiwyg-markdown@thismr/bitmindtest-core@shonaui/core@qfast/country-region-data@max_alieksieiev/react-pdf-viewer-root@oriduk/ckeditor5-rebuild-musicanote@oriduk/ckeditor5-rebuild-oriduk@rbc-public/react-selectable-fast@resystem/ida-js-sdk@react-18-pdf/root@sackmanson/quill-image-uploader@seculum/vue-dev-clonealisselisss-lab3@zh0st/evm-chainsaxios-yet-another-proxy-fix@acm-will/add-to-calendar-button@beldore/react-otp-inputbonatto@dan/cryptocoins-icons@cube-design/react@blazinaj/app-kitbridgeline-kabinetcampus-carosellocampus1campus2campus3campus4caropcarop2carop3carop4carosello-campus-opacitacarosello-tribuscarosello-tribus-2case-gg-editorcar-cmp-2@carhoo/widget-dealers3.0.0@brucearmstrong/sass-librarylayui-customgrid-component-react-ex-1guruwayguruway.jshcm-jsfastlion-picture-viewerfishzerofenglin-uploaderfrdrk-js-semaphoreevanutilsfork-react-ffmpegforminput-ui-libqa_hddprova-2-caroselloprova-cmpprova-cpm-2prova-cpm-3prova-cpm-4radintlmrangoli-cssqyx-hmtldiffprimeng-customowt-client-javascriptreact-otp-input-uptdreact-native-video-typopeter.you.jqweui.test.publishplugin_test01rcket-deployrckt-deployselect2-selectalltwine-libtwine-libraryvite_vue3_ts_ssssdddddyyyyvideo-multi-uploadervue-dev-clonetip4tinymce-plugin-toytextfield-samplevue-v3-yandex-metrika@kalkanisys/vue-select@kirrosh/pts@min98/layui-customwc-starterkitwed_developer
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

7 years ago

1.0.0

7 years ago