detect-arch 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# detect-arch
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/detect-arch)
|
|
4
|
+
[](https://www.npmjs.com/package/detect-arch)
|
|
5
|
+
|
|
3
6
|
A CPU architecture detection library without relying on User Agent strings or Browser APIs.
|
|
4
7
|
|
|
5
8
|
Inferring the host CPU architecture by observing NaN bit patterns.
|
|
@@ -10,6 +13,43 @@ Inferring the host CPU architecture by observing NaN bit patterns.
|
|
|
10
13
|
$ pnpm install detect-arch
|
|
11
14
|
```
|
|
12
15
|
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### ESM
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
import detectArch from "detect-arch";
|
|
22
|
+
|
|
23
|
+
console.log("isX86:", await detectArch.isX86());
|
|
24
|
+
console.log("isArm:", await detectArch.isArm());
|
|
25
|
+
console.log("isRiscV:", await detectArch.isRiscV());
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### CJS
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
const detectArch = require("detect-arch");
|
|
32
|
+
|
|
33
|
+
(async () => {
|
|
34
|
+
console.log("isX86:", await detectArch.isX86());
|
|
35
|
+
console.log("isArm:", await detectArch.isArm());
|
|
36
|
+
console.log("isRiscV:", await detectArch.isRiscV());
|
|
37
|
+
})();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Script tag
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
<script src="https://cdn.jsdelivr.net/npm/detect-arch@1/dist/detect-arch.iife.min.js"></script>
|
|
44
|
+
<script>
|
|
45
|
+
(async () => {
|
|
46
|
+
console.log("isX86:", await detectArch.isX86());
|
|
47
|
+
console.log("isArm:", await detectArch.isArm());
|
|
48
|
+
console.log("isRiscV:", await detectArch.isRiscV());
|
|
49
|
+
})();
|
|
50
|
+
</script>
|
|
51
|
+
```
|
|
52
|
+
|
|
13
53
|
## Build
|
|
14
54
|
|
|
15
55
|
```bash
|