@jeanregisser/chipkey 0.0.0
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/bin/.gitignore +4 -0
- package/bin/chipkey.js +11 -0
- package/index.js +25 -0
- package/package.json +20 -0
package/bin/.gitignore
ADDED
package/bin/chipkey.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
const { execFileSync } = require('child_process')
|
|
5
|
+
const { resolveBinary } = require('../index.js')
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
execFileSync(resolveBinary(), process.argv.slice(2), { stdio: 'inherit' })
|
|
9
|
+
} catch (/** @type {any} */ e) {
|
|
10
|
+
process.exit(e.status ?? 1)
|
|
11
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const path = require('path')
|
|
4
|
+
|
|
5
|
+
function resolveBinary() {
|
|
6
|
+
const { platform, arch } = process
|
|
7
|
+
|
|
8
|
+
if (platform === 'darwin') {
|
|
9
|
+
return path.join(__dirname, 'bin', 'Chipkey.app', 'Contents', 'MacOS', 'chipkey')
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (platform === 'linux') {
|
|
13
|
+
const cpu = arch === 'arm64' ? 'arm64' : 'x64'
|
|
14
|
+
return path.join(__dirname, 'bin', `chipkey-linux-${cpu}`)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (platform === 'win32') {
|
|
18
|
+
const cpu = arch === 'arm64' ? 'arm64' : 'x64'
|
|
19
|
+
return path.join(__dirname, 'bin', `chipkey-win32-${cpu}.exe`)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
throw new Error(`chipkey: unsupported platform "${platform}" (${arch})`)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = { resolveBinary }
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jeanregisser/chipkey",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Hardware-backed key management CLI using Secure Enclave (macOS) and TPM 2.0 (Linux/Windows)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/jeanregisser/chipkey.git"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"chipkey": "bin/chipkey.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin",
|
|
15
|
+
"index.js"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18"
|
|
19
|
+
}
|
|
20
|
+
}
|