README.md (7709B)
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 # Constants 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 constants. 26 27 <section class="installation"> 28 29 ## Installation 30 31 ```bash 32 npm install @stdlib/constants 33 ``` 34 35 </section> 36 37 <section class="usage"> 38 39 ## Usage 40 41 ```javascript 42 var constants = require( '@stdlib/constants' ); 43 ``` 44 45 #### constants 46 47 Standard library constants. 48 49 ```javascript 50 var ns = constants; 51 // returns {...} 52 ``` 53 54 The constants that are part of this package live in the following sub-namespaces: 55 56 <!-- <toc pattern="*"> --> 57 58 <div class="namespace-toc"> 59 60 - <span class="signature">[`array`][@stdlib/constants/array]</span><span class="delimiter">: </span><span class="description">array constants.</span> 61 - <span class="signature">[`complex128`][@stdlib/constants/complex128]</span><span class="delimiter">: </span><span class="description">128-bit complex number mathematical constant.</span> 62 - <span class="signature">[`complex64`][@stdlib/constants/complex64]</span><span class="delimiter">: </span><span class="description">half-precision floating-point mathematical constants.</span> 63 - <span class="signature">[`float16`][@stdlib/constants/float16]</span><span class="delimiter">: </span><span class="description">half-precision floating-point mathematical constants.</span> 64 - <span class="signature">[`float32`][@stdlib/constants/float32]</span><span class="delimiter">: </span><span class="description">single-precision floating-point mathematical constants.</span> 65 - <span class="signature">[`float64`][@stdlib/constants/float64]</span><span class="delimiter">: </span><span class="description">double-precision floating-point mathematical constants.</span> 66 - <span class="signature">[`int16`][@stdlib/constants/int16]</span><span class="delimiter">: </span><span class="description">16-bit signed integer mathematical constants.</span> 67 - <span class="signature">[`int32`][@stdlib/constants/int32]</span><span class="delimiter">: </span><span class="description">32-bit signed integer mathematical constants.</span> 68 - <span class="signature">[`int8`][@stdlib/constants/int8]</span><span class="delimiter">: </span><span class="description">8-bit signed integer mathematical constants.</span> 69 - <span class="signature">[`path`][@stdlib/constants/path]</span><span class="delimiter">: </span><span class="description">standard library string path constants.</span> 70 - <span class="signature">[`time`][@stdlib/constants/time]</span><span class="delimiter">: </span><span class="description">time constants.</span> 71 - <span class="signature">[`uint16`][@stdlib/constants/uint16]</span><span class="delimiter">: </span><span class="description">16-bit unsigned integer mathematical constants.</span> 72 - <span class="signature">[`uint32`][@stdlib/constants/uint32]</span><span class="delimiter">: </span><span class="description">32-bit unsigned integer mathematical constants.</span> 73 - <span class="signature">[`uint8`][@stdlib/constants/uint8]</span><span class="delimiter">: </span><span class="description">8-bit unsigned integer mathematical constants.</span> 74 - <span class="signature">[`unicode`][@stdlib/constants/unicode]</span><span class="delimiter">: </span><span class="description">standard library string unicode constants.</span> 75 76 </div> 77 78 <!-- </toc> --> 79 80 </section> 81 82 <!-- /.usage --> 83 84 <section class="examples"> 85 86 ## Examples 87 88 <!-- eslint no-undef: "error" --> 89 90 ```javascript 91 var objectKeys = require( '@stdlib/utils/keys' ); 92 var constants = require( '@stdlib/constants' ); 93 94 var out = constants.float64.PI; 95 // returns ~3.142 96 97 out = constants.array.MAX_ARRAY_LENGTH; 98 // returns 4294967295 99 100 out = constants.time.HOURS_IN_DAY; 101 // returns 24 102 ``` 103 104 </section> 105 106 <!-- /.examples --> 107 108 109 <section class="main-repo" > 110 111 * * * 112 113 ## Notice 114 115 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. 116 117 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]. 118 119 #### Community 120 121 [![Chat][chat-image]][chat-url] 122 123 --- 124 125 ## License 126 127 See [LICENSE][stdlib-license]. 128 129 130 ## Copyright 131 132 Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors]. 133 134 </section> 135 136 <!-- /.stdlib --> 137 138 <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 139 140 <section class="links"> 141 142 [npm-image]: http://img.shields.io/npm/v/@stdlib/constants.svg 143 [npm-url]: https://npmjs.org/package/@stdlib/constants 144 145 [test-image]: https://github.com/stdlib-js/constants/actions/workflows/test.yml/badge.svg 146 [test-url]: https://github.com/stdlib-js/constants/actions/workflows/test.yml 147 148 [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/constants/main.svg 149 [coverage-url]: https://codecov.io/github/stdlib-js/constants?branch=main 150 151 [dependencies-image]: https://img.shields.io/david/stdlib-js/constants.svg 152 [dependencies-url]: https://david-dm.org/stdlib-js/constants/main 153 154 [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg 155 [chat-url]: https://gitter.im/stdlib-js/stdlib/ 156 157 [stdlib]: https://github.com/stdlib-js/stdlib 158 159 [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors 160 161 [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/constants/main/LICENSE 162 163 <!-- <toc-links> --> 164 165 [@stdlib/constants/array]: https://www.npmjs.com/package/@stdlib/constants/tree/main/array 166 167 [@stdlib/constants/complex128]: https://www.npmjs.com/package/@stdlib/constants/tree/main/complex128 168 169 [@stdlib/constants/complex64]: https://www.npmjs.com/package/@stdlib/constants/tree/main/complex64 170 171 [@stdlib/constants/float16]: https://www.npmjs.com/package/@stdlib/constants/tree/main/float16 172 173 [@stdlib/constants/float32]: https://www.npmjs.com/package/@stdlib/constants/tree/main/float32 174 175 [@stdlib/constants/float64]: https://www.npmjs.com/package/@stdlib/constants/tree/main/float64 176 177 [@stdlib/constants/int16]: https://www.npmjs.com/package/@stdlib/constants/tree/main/int16 178 179 [@stdlib/constants/int32]: https://www.npmjs.com/package/@stdlib/constants/tree/main/int32 180 181 [@stdlib/constants/int8]: https://www.npmjs.com/package/@stdlib/constants/tree/main/int8 182 183 [@stdlib/constants/path]: https://www.npmjs.com/package/@stdlib/constants/tree/main/path 184 185 [@stdlib/constants/time]: https://www.npmjs.com/package/@stdlib/constants/tree/main/time 186 187 [@stdlib/constants/uint16]: https://www.npmjs.com/package/@stdlib/constants/tree/main/uint16 188 189 [@stdlib/constants/uint32]: https://www.npmjs.com/package/@stdlib/constants/tree/main/uint32 190 191 [@stdlib/constants/uint8]: https://www.npmjs.com/package/@stdlib/constants/tree/main/uint8 192 193 [@stdlib/constants/unicode]: https://www.npmjs.com/package/@stdlib/constants/tree/main/unicode 194 195 <!-- </toc-links> --> 196 197 </section> 198 199 <!-- /.links -->