source: imaps-frontend/node_modules/detect-libc/README.md@ 0c6b92a

main
Last change on this file since 0c6b92a was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago

Pred finalna verzija

  • Property mode set to 100644
File size: 2.4 KB
Line 
1# detect-libc
2
3Node.js module to detect the C standard library (libc) implementation
4family and version in use on a given Linux system.
5
6Provides a value suitable for use with the `LIBC` option of
7[prebuild](https://www.npmjs.com/package/prebuild),
8[prebuild-ci](https://www.npmjs.com/package/prebuild-ci) and
9[prebuild-install](https://www.npmjs.com/package/prebuild-install),
10therefore allowing build and provision of pre-compiled binaries
11for musl-based Linux e.g. Alpine as well as glibc-based.
12
13Currently supports libc detection of `glibc` and `musl`.
14
15## Install
16
17```sh
18npm install detect-libc
19```
20
21## Usage
22
23### API
24
25```js
26const { GLIBC, MUSL, family, version, isNonGlibcLinux } = require('detect-libc');
27```
28
29* `GLIBC` is a String containing the value "glibc" for comparison with `family`.
30* `MUSL` is a String containing the value "musl" for comparison with `family`.
31* `family` is a String representing the system libc family.
32* `version` is a String representing the system libc version number.
33* `isNonGlibcLinux` is a Boolean representing whether the system is a non-glibc Linux, e.g. Alpine.
34
35### detect-libc command line tool
36
37When run on a Linux system with a non-glibc libc,
38the child command will be run with the `LIBC` environment variable
39set to the relevant value.
40
41On all other platforms will run the child command as-is.
42
43The command line feature requires `spawnSync` provided by Node v0.12+.
44
45```sh
46detect-libc child-command
47```
48
49## Integrating with prebuild
50
51```json
52 "scripts": {
53 "install": "detect-libc prebuild-install || node-gyp rebuild",
54 "test": "mocha && detect-libc prebuild-ci"
55 },
56 "dependencies": {
57 "detect-libc": "^1.0.2",
58 "prebuild-install": "^2.2.0"
59 },
60 "devDependencies": {
61 "prebuild": "^6.2.1",
62 "prebuild-ci": "^2.2.3"
63 }
64```
65
66## Licence
67
68Copyright 2017 Lovell Fuller
69
70Licensed under the Apache License, Version 2.0 (the "License");
71you may not use this file except in compliance with the License.
72You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
73
74Unless required by applicable law or agreed to in writing, software
75distributed under the License is distributed on an "AS IS" BASIS,
76WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
77See the License for the specific language governing permissions and
78limitations under the License.
Note: See TracBrowser for help on using the repository browser.