@jarkkojs/readseek 0.1.2

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.
Files changed (3) hide show
  1. package/README.md +12 -0
  2. package/bin/readmap.js +60 -0
  3. package/package.json +32 -0
package/README.md ADDED
@@ -0,0 +1,12 @@
1
+ # readseek
2
+
3
+ `readseek` is a structural read tool, which improves the scripted read accuracy
4
+ via line hashing and symbolic mapping.
5
+
6
+ `readseek` is inspired by and based on the ideas of
7
+ [`pi-hashline-readmap`](https://github.com/coctostan/pi-hashline-readmap).
8
+
9
+
10
+ ## Licensing
11
+
12
+ `readseek` is licensed under the `LGPL-2.1-or-later` license.
package/bin/readmap.js ADDED
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+ // SPDX-License-Identifier: LGPL-2.1-or-later
3
+ // Copyright (C) Jarkko Sakkinen 2026
4
+
5
+ const { execFileSync } = require('node:child_process');
6
+ const fs = require('node:fs');
7
+ const path = require('node:path');
8
+
9
+ function resolveBinary() {
10
+ const platform = process.platform;
11
+
12
+ let packageName;
13
+ let binaryName = 'readseek';
14
+
15
+ switch (platform) {
16
+ case 'linux':
17
+ packageName = '@jarkkojs/readseek-linux-x64';
18
+ break;
19
+ case 'darwin':
20
+ packageName = '@jarkkojs/readseek-darwin-arm64';
21
+ break;
22
+ case 'win32':
23
+ packageName = '@jarkkojs/readseek-win32-x64';
24
+ binaryName = 'readseek.exe';
25
+ break;
26
+ default:
27
+ throw new Error(`unsupported platform: ${platform}`);
28
+ }
29
+
30
+ let packageDir;
31
+ try {
32
+ packageDir = path.dirname(
33
+ require.resolve(`${packageName}/package.json`, { paths: [__dirname] })
34
+ );
35
+ } catch {
36
+ throw new Error(
37
+ `package ${packageName} is not installed; ` +
38
+ 'install the optional platform-specific dependency'
39
+ );
40
+ }
41
+
42
+ const binaryPath = path.join(packageDir, 'bin', binaryName);
43
+ if (!fs.existsSync(binaryPath)) {
44
+ throw new Error(`binary not found: ${binaryPath}`);
45
+ }
46
+
47
+ return binaryPath;
48
+ }
49
+
50
+ try {
51
+ const binary = resolveBinary();
52
+ const args = process.argv.slice(2);
53
+ execFileSync(binary, args, { stdio: 'inherit' });
54
+ } catch (err) {
55
+ if (typeof err.status === 'number') {
56
+ process.exit(err.status);
57
+ }
58
+ console.error(err.message);
59
+ process.exit(1);
60
+ }
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@jarkkojs/readseek",
3
+ "version": "0.1.2",
4
+ "description": "A structural read command",
5
+ "license": "LGPL-2.1-or-later",
6
+ "homepage": "https://github.com/jarkkojs/readseek#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/jarkkojs/readseek.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/jarkkojs/readseek/issues"
13
+ },
14
+ "bin": {
15
+ "readseek": "bin/readseek.js"
16
+ },
17
+ "files": [
18
+ "bin",
19
+ "README.md"
20
+ ],
21
+ "optionalDependencies": {
22
+ "@jarkkojs/readseek-darwin-arm64": "0.1.2",
23
+ "@jarkkojs/readseek-linux-x64": "0.1.2",
24
+ "@jarkkojs/readseek-win32-x64": "0.1.2"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "engines": {
30
+ "node": ">=18"
31
+ }
32
+ }