@ohos-ports/redis 6.2.1-beta.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,WAAW,EAEX,kBAAkB,EAClB,eAAe,IAAI,sBAAsB,EAEzC,mBAAmB,EACnB,gBAAgB,IAAI,uBAAuB,EAC3C,oBAAoB,EACpB,iBAAiB,IAAI,wBAAwB,EAG7C,mBAAmB,IAAI,0BAA0B,EACjD,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAMvB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AAEnC,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAG,EAAE,EAC3B,CAAC,SAAS,cAAc,GAAG,EAAE,EAC7B,CAAC,SAAS,YAAY,GAAG,EAAE,EAC3B,IAAI,SAAS,YAAY,GAAG,CAAC,EAC7B,YAAY,SAAS,WAAW,GAAG,EAAE,EAErC,OAAO,EAAE,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,GACzD,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,CAQhD"}
package/dist/index.js ADDED
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.createSentinel = exports.createCluster = exports.createClientPool = exports.createClient = void 0;
21
+ const client_1 = require("@redis/client");
22
+ const bloom_1 = __importDefault(require("@redis/bloom"));
23
+ const json_1 = __importDefault(require("@redis/json"));
24
+ const search_1 = __importDefault(require("@redis/search"));
25
+ const time_series_1 = __importDefault(require("@redis/time-series"));
26
+ __exportStar(require("@redis/client"), exports);
27
+ __exportStar(require("@redis/bloom"), exports);
28
+ __exportStar(require("@redis/json"), exports);
29
+ __exportStar(require("@redis/search"), exports);
30
+ __exportStar(require("@redis/time-series"), exports);
31
+ const modules = {
32
+ ...bloom_1.default,
33
+ json: json_1.default,
34
+ ft: search_1.default,
35
+ ts: time_series_1.default
36
+ };
37
+ function createClient(options) {
38
+ return (0, client_1.createClient)({
39
+ ...options,
40
+ modules: {
41
+ ...modules,
42
+ ...options?.modules
43
+ }
44
+ });
45
+ }
46
+ exports.createClient = createClient;
47
+ function createClientPool(clientOptions, options) {
48
+ return (0, client_1.createClientPool)({
49
+ ...clientOptions,
50
+ modules: {
51
+ ...modules,
52
+ ...clientOptions?.modules
53
+ }
54
+ }, options);
55
+ }
56
+ exports.createClientPool = createClientPool;
57
+ /**
58
+ * Creates a new Redis Cluster client.
59
+ *
60
+ * Note: `rootNodes` is only used to discover the cluster topology; its configuration is not
61
+ * inherited by the connections made to the discovered nodes. Any setting that should apply to
62
+ * every connection in the cluster (e.g. credentials, TLS) must be specified via `defaults`.
63
+ */
64
+ function createCluster(options) {
65
+ return (0, client_1.createCluster)({
66
+ ...options,
67
+ modules: {
68
+ ...modules,
69
+ ...options?.modules
70
+ }
71
+ });
72
+ }
73
+ exports.createCluster = createCluster;
74
+ function createSentinel(options) {
75
+ return (0, client_1.createSentinel)({
76
+ ...options,
77
+ modules: {
78
+ ...modules,
79
+ ...options?.modules
80
+ }
81
+ });
82
+ }
83
+ exports.createSentinel = createSentinel;
84
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,0CAkBuB;AACvB,yDAA6C;AAC7C,uDAAoC;AACpC,2DAAuC;AACvC,qEAAiD;AAEjD,gDAA8B;AAC9B,+CAA6B;AAC7B,8CAA4B;AAC5B,gDAA8B;AAC9B,qDAAmC;AAEnC,MAAM,OAAO,GAAG;IACd,GAAG,eAAiB;IACpB,IAAI,EAAE,cAAS;IACf,EAAE,EAAE,gBAAU;IACd,EAAE,EAAE,qBAAe;CACpB,CAAC;AAaF,SAAgB,YAAY,CAO1B,OAAyD;IAEzD,OAAO,IAAA,qBAAmB,EAAC;QACzB,GAAG,OAAO;QACV,OAAO,EAAE;YACP,GAAG,OAAO;YACV,GAAI,OAAO,EAAE,OAAa;SAC3B;KACF,CAAiD,CAAC;AACrD,CAAC;AAhBD,oCAgBC;AAED,SAAgB,gBAAgB,CAM9B,aAAwF,EACxF,OAAmC;IACnC,OAAO,IAAA,yBAAuB,EAAC;QAC7B,GAAG,aAAa;QAChB,OAAO,EAAE;YACP,GAAG,OAAO;YACV,GAAI,aAAa,EAAE,OAAa;SACjC;KACF,EAAE,OAAO,CAAqD,CAAC;AAClE,CAAC;AAfD,4CAeC;AAkBD;;;;;;GAMG;AACH,SAAgB,aAAa,CAO3B,OAAyD;IAEzD,OAAO,IAAA,sBAAoB,EAAC;QAC1B,GAAG,OAAO;QACV,OAAO,EAAE;YACP,GAAG,OAAO;YACV,GAAI,OAAO,EAAE,OAAa;SAC3B;KACF,CAAkD,CAAC;AACtD,CAAC;AAhBD,sCAgBC;AAUD,SAAgB,cAAc,CAO5B,OAA0D;IAE1D,OAAO,IAAA,uBAAqB,EAAC;QAC3B,GAAG,OAAO;QACV,OAAO,EAAE;YACP,GAAG,OAAO;YACV,GAAI,OAAO,EAAE,OAAa;SAC3B;KACF,CAAmD,CAAC;AACvD,CAAC;AAhBD,wCAgBC","sourcesContent":["import {\n RedisModules,\n RedisFunctions,\n RedisScripts,\n RespVersions,\n TypeMapping,\n createClient as genericCreateClient,\n RedisClientOptions,\n RedisClientType as GenericRedisClientType,\n createCluster as genericCreateCluster,\n RedisClusterOptions,\n RedisClusterType as genericRedisClusterType,\n RedisSentinelOptions,\n RedisSentinelType as genericRedisSentinelType,\n createSentinel as genericCreateSentinel,\n createClientPool as genericCreateClientPool,\n RedisClientPoolType as GenericRedisClientPoolType,\n RedisPoolOptions,\n} from '@redis/client';\nimport RedisBloomModules from '@redis/bloom';\nimport RedisJSON from '@redis/json';\nimport RediSearch from '@redis/search';\nimport RedisTimeSeries from '@redis/time-series';\n\nexport * from '@redis/client';\nexport * from '@redis/bloom';\nexport * from '@redis/json';\nexport * from '@redis/search';\nexport * from '@redis/time-series';\n\nconst modules = {\n ...RedisBloomModules,\n json: RedisJSON,\n ft: RediSearch,\n ts: RedisTimeSeries\n};\n\ntype RedisStackModules = typeof modules;\nexport interface RedisDefaultModules extends RedisStackModules {}\n\nexport type RedisClientType<\n M extends RedisModules = {},\n F extends RedisFunctions = {},\n S extends RedisScripts = {},\n RESP extends RespVersions = 3,\n TYPE_MAPPING extends TypeMapping = {}\n> = GenericRedisClientType<RedisDefaultModules & M, F, S, RESP, TYPE_MAPPING>;\n\nexport function createClient<\n M extends RedisModules = {},\n F extends RedisFunctions = {},\n S extends RedisScripts = {},\n RESP extends RespVersions = 3,\n TYPE_MAPPING extends TypeMapping = {}\n>(\n options?: RedisClientOptions<M, F, S, RESP, TYPE_MAPPING>\n): RedisClientType<M, F, S, RESP, TYPE_MAPPING> {\n return genericCreateClient({\n ...options,\n modules: {\n ...modules,\n ...(options?.modules as M)\n }\n }) as RedisClientType<M, F, S, RESP, TYPE_MAPPING>;\n}\n\nexport function createClientPool<\n M extends RedisModules = {},\n F extends RedisFunctions = {},\n S extends RedisScripts = {},\n RESP extends RespVersions = 3,\n TYPE_MAPPING extends TypeMapping = {}\n>(clientOptions?: Omit<RedisClientOptions<M, F, S, RESP, TYPE_MAPPING>, \"clientSideCache\">,\n options?: Partial<RedisPoolOptions>): RedisClientPoolType<M, F, S, RESP, TYPE_MAPPING> {\n return genericCreateClientPool({\n ...clientOptions,\n modules: {\n ...modules,\n ...(clientOptions?.modules as M)\n }\n }, options) as RedisClientPoolType<M, F, S, RESP, TYPE_MAPPING>;\n}\n\nexport type RedisClientPoolType<\n M extends RedisModules = {},\n F extends RedisFunctions = {},\n S extends RedisScripts = {},\n RESP extends RespVersions = 3,\n TYPE_MAPPING extends TypeMapping = {}\n> = GenericRedisClientPoolType<RedisDefaultModules & M, F, S, RESP, TYPE_MAPPING>;\n\nexport type RedisClusterType<\n M extends RedisModules = {},\n F extends RedisFunctions = {},\n S extends RedisScripts = {},\n RESP extends RespVersions = 3,\n TYPE_MAPPING extends TypeMapping = {}\n> = genericRedisClusterType<RedisDefaultModules & M, F, S, RESP, TYPE_MAPPING>;\n\n/**\n * Creates a new Redis Cluster client.\n *\n * Note: `rootNodes` is only used to discover the cluster topology; its configuration is not\n * inherited by the connections made to the discovered nodes. Any setting that should apply to\n * every connection in the cluster (e.g. credentials, TLS) must be specified via `defaults`.\n */\nexport function createCluster<\n M extends RedisModules = {},\n F extends RedisFunctions = {},\n S extends RedisScripts = {},\n RESP extends RespVersions = 3,\n TYPE_MAPPING extends TypeMapping = {}\n>(\n options: RedisClusterOptions<M, F, S, RESP, TYPE_MAPPING>\n): RedisClusterType<M, F, S, RESP, TYPE_MAPPING> {\n return genericCreateCluster({\n ...options,\n modules: {\n ...modules,\n ...(options?.modules as M)\n }\n }) as RedisClusterType<M, F, S, RESP, TYPE_MAPPING>;\n}\n\nexport type RedisSentinelType<\n M extends RedisModules = {},\n F extends RedisFunctions = {},\n S extends RedisScripts = {},\n RESP extends RespVersions = 3,\n TYPE_MAPPING extends TypeMapping = {}\n> = genericRedisSentinelType<RedisDefaultModules & M, F, S, RESP, TYPE_MAPPING>;\n\nexport function createSentinel<\n M extends RedisModules = {},\n F extends RedisFunctions = {},\n S extends RedisScripts = {},\n RESP extends RespVersions = 3,\n TYPE_MAPPING extends TypeMapping = {}\n>(\n options: RedisSentinelOptions<M, F, S, RESP, TYPE_MAPPING>\n): RedisSentinelType<M, F, S, RESP, TYPE_MAPPING> {\n return genericCreateSentinel({\n ...options,\n modules: {\n ...modules,\n ...(options?.modules as M)\n }\n }) as RedisSentinelType<M, F, S, RESP, TYPE_MAPPING>;\n}\n\n"]}
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@ohos-ports/redis",
3
+ "description": "A modern, high performance Redis client",
4
+ "version": "6.2.1-beta.1",
5
+ "license": "MIT",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist/",
10
+ "vendor/",
11
+ "!dist/tsconfig.tsbuildinfo"
12
+ ],
13
+ "scripts": {
14
+ "release": "release-it"
15
+ },
16
+ "dependencies": {
17
+ "@node-rs/xxhash": "file:vendor/@node-rs/xxhash",
18
+ "@redis/bloom": "6.2.1",
19
+ "@redis/client": "6.2.1",
20
+ "@redis/json": "6.2.1",
21
+ "@redis/search": "6.2.1",
22
+ "@redis/time-series": "6.2.1"
23
+ },
24
+ "engines": {
25
+ "node": ">= 20.0.0"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/ohos-ports/ohos-ports.git",
30
+ "directory": "ports/redis/6.2.1"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/ohos-ports/ohos-ports/issues"
34
+ },
35
+ "homepage": "https://github.com/ohos-ports/ohos-ports/tree/main/ports/redis/6.2.1",
36
+ "keywords": [
37
+ "redis"
38
+ ]
39
+ }
@@ -0,0 +1 @@
1
+ export * from '@node-rs/xxhash-wasm32-wasi'
@@ -0,0 +1,33 @@
1
+ /* auto-generated by NAPI-RS */
2
+ /* eslint-disable */
3
+ export declare class Xxh32 {
4
+ constructor(seed?: number | undefined | null)
5
+ update(input: string | Uint8Array): this
6
+ digest(): number
7
+ reset(newState?: number | undefined | null): void
8
+ }
9
+
10
+ export declare class Xxh64 {
11
+ constructor(seed?: bigint | undefined | null)
12
+ update(input: string | Uint8Array): this
13
+ digest(): bigint
14
+ reset(newState?: bigint | undefined | null): void
15
+ }
16
+
17
+ export declare function xxh32(input: Uint8Array | string, seed?: number | undefined | null): number
18
+
19
+ export declare function xxh64(input: Uint8Array | string, seed?: bigint | undefined | null): bigint
20
+
21
+ export declare namespace xxh3 {
22
+ export class Xxh3 {
23
+ static withSeed(seed?: bigint | undefined | null): Xxh3
24
+ static withSecret(secret: Uint8Array): Xxh3
25
+ update(input: string | Uint8Array): this
26
+ digest(): bigint
27
+ reset(): void
28
+ }
29
+ export function xxh128(input: string | Uint8Array, seed?: bigint | undefined | null): bigint
30
+ export function xxh128WithSecret(input: string | Uint8Array, secret: Uint8Array): bigint
31
+ export function xxh64(input: Uint8Array | string, seed?: bigint | undefined | null): bigint
32
+ export function xxh64WithSecret(input: string | Uint8Array, secret: Uint8Array): bigint
33
+ }
@@ -0,0 +1,382 @@
1
+ // prettier-ignore
2
+ /* eslint-disable */
3
+ // @ts-nocheck
4
+ /* auto-generated by NAPI-RS */
5
+
6
+ const { createRequire } = require('node:module')
7
+ require = createRequire(__filename)
8
+
9
+ const { readFileSync } = require('node:fs')
10
+ let nativeBinding = null
11
+ const loadErrors = []
12
+
13
+ const isMusl = () => {
14
+ let musl = false
15
+ if (process.platform === 'linux') {
16
+ musl = isMuslFromFilesystem()
17
+ if (musl === null) {
18
+ musl = isMuslFromReport()
19
+ }
20
+ if (musl === null) {
21
+ musl = isMuslFromChildProcess()
22
+ }
23
+ }
24
+ return musl
25
+ }
26
+
27
+ const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
28
+
29
+ const isMuslFromFilesystem = () => {
30
+ try {
31
+ return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
32
+ } catch {
33
+ return null
34
+ }
35
+ }
36
+
37
+ const isMuslFromReport = () => {
38
+ const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null
39
+ if (!report) {
40
+ return null
41
+ }
42
+ if (report.header && report.header.glibcVersionRuntime) {
43
+ return false
44
+ }
45
+ if (Array.isArray(report.sharedObjects)) {
46
+ if (report.sharedObjects.some(isFileMusl)) {
47
+ return true
48
+ }
49
+ }
50
+ return false
51
+ }
52
+
53
+ const isMuslFromChildProcess = () => {
54
+ try {
55
+ return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
56
+ } catch (e) {
57
+ // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
58
+ return false
59
+ }
60
+ }
61
+
62
+ function requireNative() {
63
+ if (process.platform === 'openharmony') {
64
+ if (process.arch === 'arm64') {
65
+ try {
66
+ return require('./xxhash.ohos-arm64.node')
67
+ } catch (e) {
68
+ loadErrors.push(e)
69
+ }
70
+ } else {
71
+ loadErrors.push(new Error(`Unsupported architecture on HarmonyOS: ${process.arch}`))
72
+ }
73
+ }
74
+ if (process.platform === 'android') {
75
+ if (process.arch === 'arm64') {
76
+ try {
77
+ return require('./xxhash.android-arm64.node')
78
+ } catch (e) {
79
+ loadErrors.push(e)
80
+ }
81
+ try {
82
+ return require('@node-rs/xxhash-android-arm64')
83
+ } catch (e) {
84
+ loadErrors.push(e)
85
+ }
86
+
87
+ } else if (process.arch === 'arm') {
88
+ try {
89
+ return require('./xxhash.android-arm-eabi.node')
90
+ } catch (e) {
91
+ loadErrors.push(e)
92
+ }
93
+ try {
94
+ return require('@node-rs/xxhash-android-arm-eabi')
95
+ } catch (e) {
96
+ loadErrors.push(e)
97
+ }
98
+
99
+ } else {
100
+ loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
101
+ }
102
+ } else if (process.platform === 'win32') {
103
+ if (process.arch === 'x64') {
104
+ try {
105
+ return require('./xxhash.win32-x64-msvc.node')
106
+ } catch (e) {
107
+ loadErrors.push(e)
108
+ }
109
+ try {
110
+ return require('@node-rs/xxhash-win32-x64-msvc')
111
+ } catch (e) {
112
+ loadErrors.push(e)
113
+ }
114
+
115
+ } else if (process.arch === 'ia32') {
116
+ try {
117
+ return require('./xxhash.win32-ia32-msvc.node')
118
+ } catch (e) {
119
+ loadErrors.push(e)
120
+ }
121
+ try {
122
+ return require('@node-rs/xxhash-win32-ia32-msvc')
123
+ } catch (e) {
124
+ loadErrors.push(e)
125
+ }
126
+
127
+ } else if (process.arch === 'arm64') {
128
+ try {
129
+ return require('./xxhash.win32-arm64-msvc.node')
130
+ } catch (e) {
131
+ loadErrors.push(e)
132
+ }
133
+ try {
134
+ return require('@node-rs/xxhash-win32-arm64-msvc')
135
+ } catch (e) {
136
+ loadErrors.push(e)
137
+ }
138
+
139
+ } else {
140
+ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
141
+ }
142
+ } else if (process.platform === 'darwin') {
143
+ try {
144
+ return require('./xxhash.darwin-universal.node')
145
+ } catch (e) {
146
+ loadErrors.push(e)
147
+ }
148
+ try {
149
+ return require('@node-rs/xxhash-darwin-universal')
150
+ } catch (e) {
151
+ loadErrors.push(e)
152
+ }
153
+
154
+ if (process.arch === 'x64') {
155
+ try {
156
+ return require('./xxhash.darwin-x64.node')
157
+ } catch (e) {
158
+ loadErrors.push(e)
159
+ }
160
+ try {
161
+ return require('@node-rs/xxhash-darwin-x64')
162
+ } catch (e) {
163
+ loadErrors.push(e)
164
+ }
165
+
166
+ } else if (process.arch === 'arm64') {
167
+ try {
168
+ return require('./xxhash.darwin-arm64.node')
169
+ } catch (e) {
170
+ loadErrors.push(e)
171
+ }
172
+ try {
173
+ return require('@node-rs/xxhash-darwin-arm64')
174
+ } catch (e) {
175
+ loadErrors.push(e)
176
+ }
177
+
178
+ } else {
179
+ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
180
+ }
181
+ } else if (process.platform === 'freebsd') {
182
+ if (process.arch === 'x64') {
183
+ try {
184
+ return require('./xxhash.freebsd-x64.node')
185
+ } catch (e) {
186
+ loadErrors.push(e)
187
+ }
188
+ try {
189
+ return require('@node-rs/xxhash-freebsd-x64')
190
+ } catch (e) {
191
+ loadErrors.push(e)
192
+ }
193
+
194
+ } else if (process.arch === 'arm64') {
195
+ try {
196
+ return require('./xxhash.freebsd-arm64.node')
197
+ } catch (e) {
198
+ loadErrors.push(e)
199
+ }
200
+ try {
201
+ return require('@node-rs/xxhash-freebsd-arm64')
202
+ } catch (e) {
203
+ loadErrors.push(e)
204
+ }
205
+
206
+ } else {
207
+ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
208
+ }
209
+ } else if (process.platform === 'linux') {
210
+ if (process.arch === 'x64') {
211
+ if (isMusl()) {
212
+ try {
213
+ return require('./xxhash.linux-x64-musl.node')
214
+ } catch (e) {
215
+ loadErrors.push(e)
216
+ }
217
+ try {
218
+ return require('@node-rs/xxhash-linux-x64-musl')
219
+ } catch (e) {
220
+ loadErrors.push(e)
221
+ }
222
+
223
+ } else {
224
+ try {
225
+ return require('./xxhash.linux-x64-gnu.node')
226
+ } catch (e) {
227
+ loadErrors.push(e)
228
+ }
229
+ try {
230
+ return require('@node-rs/xxhash-linux-x64-gnu')
231
+ } catch (e) {
232
+ loadErrors.push(e)
233
+ }
234
+
235
+ }
236
+ } else if (process.arch === 'arm64') {
237
+ if (isMusl()) {
238
+ try {
239
+ return require('./xxhash.linux-arm64-musl.node')
240
+ } catch (e) {
241
+ loadErrors.push(e)
242
+ }
243
+ try {
244
+ return require('@node-rs/xxhash-linux-arm64-musl')
245
+ } catch (e) {
246
+ loadErrors.push(e)
247
+ }
248
+
249
+ } else {
250
+ try {
251
+ return require('./xxhash.linux-arm64-gnu.node')
252
+ } catch (e) {
253
+ loadErrors.push(e)
254
+ }
255
+ try {
256
+ return require('@node-rs/xxhash-linux-arm64-gnu')
257
+ } catch (e) {
258
+ loadErrors.push(e)
259
+ }
260
+
261
+ }
262
+ } else if (process.arch === 'arm') {
263
+ if (isMusl()) {
264
+ try {
265
+ return require('./xxhash.linux-arm-musleabihf.node')
266
+ } catch (e) {
267
+ loadErrors.push(e)
268
+ }
269
+ try {
270
+ return require('@node-rs/xxhash-linux-arm-musleabihf')
271
+ } catch (e) {
272
+ loadErrors.push(e)
273
+ }
274
+
275
+ } else {
276
+ try {
277
+ return require('./xxhash.linux-arm-gnueabihf.node')
278
+ } catch (e) {
279
+ loadErrors.push(e)
280
+ }
281
+ try {
282
+ return require('@node-rs/xxhash-linux-arm-gnueabihf')
283
+ } catch (e) {
284
+ loadErrors.push(e)
285
+ }
286
+
287
+ }
288
+ } else if (process.arch === 'riscv64') {
289
+ if (isMusl()) {
290
+ try {
291
+ return require('./xxhash.linux-riscv64-musl.node')
292
+ } catch (e) {
293
+ loadErrors.push(e)
294
+ }
295
+ try {
296
+ return require('@node-rs/xxhash-linux-riscv64-musl')
297
+ } catch (e) {
298
+ loadErrors.push(e)
299
+ }
300
+
301
+ } else {
302
+ try {
303
+ return require('./xxhash.linux-riscv64-gnu.node')
304
+ } catch (e) {
305
+ loadErrors.push(e)
306
+ }
307
+ try {
308
+ return require('@node-rs/xxhash-linux-riscv64-gnu')
309
+ } catch (e) {
310
+ loadErrors.push(e)
311
+ }
312
+
313
+ }
314
+ } else if (process.arch === 'ppc64') {
315
+ try {
316
+ return require('./xxhash.linux-ppc64-gnu.node')
317
+ } catch (e) {
318
+ loadErrors.push(e)
319
+ }
320
+ try {
321
+ return require('@node-rs/xxhash-linux-ppc64-gnu')
322
+ } catch (e) {
323
+ loadErrors.push(e)
324
+ }
325
+
326
+ } else if (process.arch === 's390x') {
327
+ try {
328
+ return require('./xxhash.linux-s390x-gnu.node')
329
+ } catch (e) {
330
+ loadErrors.push(e)
331
+ }
332
+ try {
333
+ return require('@node-rs/xxhash-linux-s390x-gnu')
334
+ } catch (e) {
335
+ loadErrors.push(e)
336
+ }
337
+
338
+ } else {
339
+ loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
340
+ }
341
+ } else {
342
+ loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
343
+ }
344
+ }
345
+
346
+ nativeBinding = requireNative()
347
+
348
+ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
349
+ try {
350
+ nativeBinding = require('./xxhash.wasi.cjs')
351
+ } catch (err) {
352
+ if (process.env.NAPI_RS_FORCE_WASI) {
353
+ loadErrors.push(err)
354
+ }
355
+ }
356
+ if (!nativeBinding) {
357
+ try {
358
+ nativeBinding = require('@node-rs/xxhash-wasm32-wasi')
359
+ } catch (err) {
360
+ if (process.env.NAPI_RS_FORCE_WASI) {
361
+ loadErrors.push(err)
362
+ }
363
+ }
364
+ }
365
+ }
366
+
367
+ if (!nativeBinding) {
368
+ if (loadErrors.length > 0) {
369
+ // TODO Link to documentation with potential fixes
370
+ // - The package owner could build/publish bindings for this arch
371
+ // - The user may need to bundle the correct files
372
+ // - The user may need to re-install node_modules to get new packages
373
+ throw new Error('Failed to load native binding', { cause: loadErrors })
374
+ }
375
+ throw new Error(`Failed to load native binding`)
376
+ }
377
+
378
+ module.exports.Xxh32 = nativeBinding.Xxh32
379
+ module.exports.Xxh64 = nativeBinding.Xxh64
380
+ module.exports.xxh32 = nativeBinding.xxh32
381
+ module.exports.xxh64 = nativeBinding.xxh64
382
+ module.exports.xxh3 = nativeBinding.xxh3
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@node-rs/xxhash",
3
+ "version": "1.7.6-ohos.1",
4
+ "description": "Fastest xxhash implementation in Node.js (vendored with HarmonyOS aarch64 native binding compiled from napi-rs/node-rs source)",
5
+ "main": "index.js",
6
+ "typings": "index.d.ts",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/napi-rs/node-rs.git"
11
+ },
12
+ "napi": {
13
+ "binaryName": "xxhash",
14
+ "targets": [
15
+ "aarch64-unknown-linux-ohos"
16
+ ]
17
+ },
18
+ "engines": {
19
+ "node": ">= 12"
20
+ }
21
+ }