README.md (5672B)
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 # OS 22 23 [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url] 24 25 > Standard library OS utilities. 26 27 <section class="installation"> 28 29 ## Installation 30 31 ```bash 32 npm install @stdlib/os 33 ``` 34 35 </section> 36 37 <section class="usage"> 38 39 ## Usage 40 41 ```javascript 42 var ns = require( '@stdlib/os' ); 43 ``` 44 45 #### ns 46 47 Standard library OS utilities. 48 49 ```javascript 50 var os = ns; 51 // returns {...} 52 ``` 53 54 The namespace contains a variety of OS-related utility methods: 55 56 <!-- <toc pattern="*" ignore="+(arch|num-cpus|platform|byte-order|float-word-order)" > --> 57 58 <div class="namespace-toc"> 59 60 - <span class="signature">[`configdir( [path] )`][@stdlib/os/configdir]</span><span class="delimiter">: </span><span class="description">return a directory for user-specific configuration files.</span> 61 - <span class="signature">[`homedir()`][@stdlib/os/homedir]</span><span class="delimiter">: </span><span class="description">return the current user's home directory.</span> 62 - <span class="signature">[`tmpdir()`][@stdlib/os/tmpdir]</span><span class="delimiter">: </span><span class="description">return the directory for storing temporary files.</span> 63 64 </div> 65 66 <!-- </toc> --> 67 68 In addition, it exports the following constants: 69 70 <!-- <toc pattern="+(arch|num-cpus|platform|byte-order|float-word-order)" > --> 71 72 <div class="namespace-toc"> 73 74 - <span class="signature">[`ARCH`][@stdlib/os/arch]</span><span class="delimiter">: </span><span class="description">operating system CPU architecture.</span> 75 - <span class="signature">[`BYTE_ORDER`][@stdlib/os/byte-order]</span><span class="delimiter">: </span><span class="description">platform byte order.</span> 76 - <span class="signature">[`FLOAT_WORD_ORDER`][@stdlib/os/float-word-order]</span><span class="delimiter">: </span><span class="description">platform float word order.</span> 77 - <span class="signature">[`NUM_CPUS`][@stdlib/os/num-cpus]</span><span class="delimiter">: </span><span class="description">number of CPUs.</span> 78 - <span class="signature">[`PLATFORM`][@stdlib/os/platform]</span><span class="delimiter">: </span><span class="description">platform on which the current process is running.</span> 79 80 </div> 81 82 <!-- </toc> --> 83 84 </section> 85 86 <!-- /.usage --> 87 88 <section class="examples"> 89 90 ## Examples 91 92 <!-- TODO: better examples --> 93 94 <!-- eslint no-undef: "error" --> 95 96 ```javascript 97 var objectKeys = require( '@stdlib/utils/keys' ); 98 var ns = require( '@stdlib/os' ); 99 100 console.log( objectKeys( ns ) ); 101 ``` 102 103 </section> 104 105 <!-- /.examples --> 106 107 108 <section class="main-repo" > 109 110 * * * 111 112 ## Notice 113 114 This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. 115 116 For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. 117 118 #### Community 119 120 [![Chat][chat-image]][chat-url] 121 122 --- 123 124 ## License 125 126 See [LICENSE][stdlib-license]. 127 128 129 ## Copyright 130 131 Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors]. 132 133 </section> 134 135 <!-- /.stdlib --> 136 137 <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 138 139 <section class="links"> 140 141 [npm-image]: http://img.shields.io/npm/v/@stdlib/os.svg 142 [npm-url]: https://npmjs.org/package/@stdlib/os 143 144 [test-image]: https://github.com/stdlib-js/os/actions/workflows/test.yml/badge.svg 145 [test-url]: https://github.com/stdlib-js/os/actions/workflows/test.yml 146 147 [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/os/main.svg 148 [coverage-url]: https://codecov.io/github/stdlib-js/os?branch=main 149 150 [dependencies-image]: https://img.shields.io/david/stdlib-js/os.svg 151 [dependencies-url]: https://david-dm.org/stdlib-js/os/main 152 153 [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg 154 [chat-url]: https://gitter.im/stdlib-js/stdlib/ 155 156 [stdlib]: https://github.com/stdlib-js/stdlib 157 158 [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors 159 160 [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/os/main/LICENSE 161 162 <!-- <toc-links> --> 163 164 [@stdlib/os/arch]: https://www.npmjs.com/package/@stdlib/os/tree/main/arch 165 166 [@stdlib/os/byte-order]: https://www.npmjs.com/package/@stdlib/os/tree/main/byte-order 167 168 [@stdlib/os/float-word-order]: https://www.npmjs.com/package/@stdlib/os/tree/main/float-word-order 169 170 [@stdlib/os/num-cpus]: https://www.npmjs.com/package/@stdlib/os/tree/main/num-cpus 171 172 [@stdlib/os/platform]: https://www.npmjs.com/package/@stdlib/os/tree/main/platform 173 174 [@stdlib/os/configdir]: https://www.npmjs.com/package/@stdlib/os/tree/main/configdir 175 176 [@stdlib/os/homedir]: https://www.npmjs.com/package/@stdlib/os/tree/main/homedir 177 178 [@stdlib/os/tmpdir]: https://www.npmjs.com/package/@stdlib/os/tree/main/tmpdir 179 180 <!-- </toc-links> --> 181 182 </section> 183 184 <!-- /.links -->