README.md (1715B)
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 # tmpdir 22 23 > Return the directory for storing temporary files. 24 25 <section class="usage"> 26 27 ## Usage 28 29 ```javascript 30 var tmpdir = require( '@stdlib/os/tmpdir' ); 31 ``` 32 33 #### tmpdir() 34 35 Returns the directory for storing temporary files. 36 37 ```javascript 38 var dir = tmpdir(); 39 // e.g., returns '/path/to/temporary/files/directory' 40 ``` 41 42 </section> 43 44 <!-- /.usage --> 45 46 <section class="examples"> 47 48 ## Examples 49 50 <!-- eslint no-undef: "error" --> 51 52 ```javascript 53 var PATH_SEP = require( '@stdlib/constants/path/sep' ); 54 var tmpdir = require( '@stdlib/os/tmpdir' ); 55 56 var parts = tmpdir().split( PATH_SEP ); 57 console.log( parts ); 58 ``` 59 60 </section> 61 62 <!-- /.examples --> 63 64 * * * 65 66 <section class="cli"> 67 68 ## CLI 69 70 <section class="usage"> 71 72 ### Usage 73 74 ```text 75 Usage: tmpdir [options] 76 77 Options: 78 79 -h, --help Print this message. 80 -V, --version Print the package version. 81 ``` 82 83 </section> 84 85 <!-- /.usage --> 86 87 <section class="examples"> 88 89 ### Examples 90 91 ```bash 92 $ tmpdir 93 /path/to/temporary/files/directory 94 ``` 95 96 </section> 97 98 <!-- /.examples --> 99 100 </section> 101 102 <!-- /.cli --> 103 104 <section class="links"> 105 106 </section> 107 108 <!-- /.links -->