time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

README.md (2898B)


      1 <!--
      2 
      3 @license Apache-2.0
      4 
      5 Copyright (c) 2018 The Stdlib Authors.
      6 
      7 Licensed under the Apache License, Version 2.0 (the "License");
      8 you may not use this file except in compliance with the License.
      9 You may obtain a copy of the License at
     10 
     11    http://www.apache.org/licenses/LICENSE-2.0
     12 
     13 Unless required by applicable law or agreed to in writing, software
     14 distributed under the License is distributed on an "AS IS" BASIS,
     15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 See the License for the specific language governing permissions and
     17 limitations under the License.
     18 
     19 -->
     20 
     21 # homedir
     22 
     23 > Return the current user's home directory.
     24 
     25 <!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
     26 
     27 <section class="intro">
     28 
     29 </section>
     30 
     31 <!-- /.intro -->
     32 
     33 <!-- Package usage documentation. -->
     34 
     35 <section class="usage">
     36 
     37 ## Usage
     38 
     39 ```javascript
     40 var homedir = require( '@stdlib/os/homedir' );
     41 ```
     42 
     43 #### homedir()
     44 
     45 Returns the current user's `home` directory.
     46 
     47 ```javascript
     48 var home = homedir();
     49 // e.g., returns '/Users/<username>'
     50 ```
     51 
     52 If unable to locate a `home` directory, the function returns `null`.
     53 
     54 </section>
     55 
     56 <!-- /.usage -->
     57 
     58 <!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
     59 
     60 <section class="notes">
     61 
     62 ## Notes
     63 
     64 -   The implementation primarily checks various [environment variables][environment-variables] to locate a `home` directory. Note that this approach has **security vulnerabilities**, as attackers can tamper with [environment variables][environment-variables].
     65 
     66 </section>
     67 
     68 <!-- /.notes -->
     69 
     70 <!-- Package usage examples. -->
     71 
     72 <section class="examples">
     73 
     74 ## Examples
     75 
     76 <!-- eslint no-undef: "error" -->
     77 
     78 ```javascript
     79 var homedir = require( '@stdlib/os/homedir' );
     80 
     81 console.log( homedir() );
     82 ```
     83 
     84 </section>
     85 
     86 <!-- /.examples -->
     87 
     88 * * *
     89 
     90 <section class="cli">
     91 
     92 ## CLI
     93 
     94 <section class="usage">
     95 
     96 ### Usage
     97 
     98 ```text
     99 Usage: homedir [options]
    100 
    101 Options:
    102 
    103   -h,    --help                Print this message.
    104   -V,    --version             Print the package version.
    105 ```
    106 
    107 </section>
    108 
    109 <!-- /.usage -->
    110 
    111 <section class="examples">
    112 
    113 ### Examples
    114 
    115 ```bash
    116 $ homedir
    117 e.g., /Users/<username>
    118 ```
    119 
    120 </section>
    121 
    122 <!-- /.examples -->
    123 
    124 </section>
    125 
    126 <!-- /.cli -->
    127 
    128 <!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
    129 
    130 <section class="references">
    131 
    132 </section>
    133 
    134 <!-- /.references -->
    135 
    136 <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
    137 
    138 <section class="links">
    139 
    140 [environment-variables]: https://en.wikipedia.org/wiki/Environment_variable
    141 
    142 </section>
    143 
    144 <!-- /.links -->