Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

homedir-polyfill

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Issues
File Explorer

Advanced tools

homedir-polyfill

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

    1.0.3latest

Version published
Maintainers
1
Weekly downloads
6,671,786
decreased by-12.29%

Weekly downloads

Readme

Source

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

Contributing

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 Tests

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
Building docs

(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

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.

Keywords

FAQs

What is homedir-polyfill?

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

Is homedir-polyfill popular?

The npm package homedir-polyfill receives a total of 5,377,797 weekly downloads. As such, homedir-polyfill popularity was classified as popular.

Is homedir-polyfill well maintained?

We found that homedir-polyfill demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 21 Feb 2019

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc