@smbcloud/cli 0.3.33
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 +7 -0
- package/lib/index.js +38 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# smbcloud-cli
|
|
2
|
+
|
|
3
|
+
This is a CLI program to access [smbcloud](https://smbcloud.xyz/).
|
|
4
|
+
|
|
5
|
+
# Important!
|
|
6
|
+
|
|
7
|
+
This is a binary executable that is compiled from [the Rust project](https://github.com/smbcloudXYZ/smbcloud-cli). Report any issue there. Refer to the repo for documentation.
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
/**
|
|
6
|
+
* Returns the executable path which is located inside `node_modules`
|
|
7
|
+
* The naming convention is cli-${os}-${arch}
|
|
8
|
+
* If the platform is `win32` or `cygwin`, executable will include a `.exe` extension.
|
|
9
|
+
* @see https://nodejs.org/api/os.html#osarch
|
|
10
|
+
* @see https://nodejs.org/api/os.html#osplatform
|
|
11
|
+
* @example "x/xx/node_modules/cli-darwin-arm64"
|
|
12
|
+
*/
|
|
13
|
+
function getExePath() {
|
|
14
|
+
const arch = process.arch;
|
|
15
|
+
let os = process.platform;
|
|
16
|
+
let extension = "";
|
|
17
|
+
if (["win32", "cygwin"].includes(process.platform)) {
|
|
18
|
+
os = "windows";
|
|
19
|
+
extension = ".exe";
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
// Since the binary will be located inside `node_modules`, we can simply call `require.resolve`
|
|
23
|
+
return require.resolve(`@smbcloud/cli-${os}-${arch}/bin/smb${extension}`);
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
throw new Error(`Couldn't find application binary inside node_modules for ${os}-${arch}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Runs the application with args using nodejs spawn
|
|
31
|
+
*/
|
|
32
|
+
function run() {
|
|
33
|
+
var _a;
|
|
34
|
+
const args = process.argv.slice(2);
|
|
35
|
+
const processResult = (0, child_process_1.spawnSync)(getExePath(), args, { stdio: "inherit" });
|
|
36
|
+
process.exit((_a = processResult.status) !== null && _a !== void 0 ? _a : 0);
|
|
37
|
+
}
|
|
38
|
+
run();
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@smbcloud/cli",
|
|
3
|
+
"version": "0.3.33",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"smbcloud",
|
|
6
|
+
"cli",
|
|
7
|
+
"smb",
|
|
8
|
+
"pndk",
|
|
9
|
+
"smbcloud-cli",
|
|
10
|
+
"cloud",
|
|
11
|
+
"smbcloud",
|
|
12
|
+
"developer",
|
|
13
|
+
"tools",
|
|
14
|
+
"web3",
|
|
15
|
+
"web3js",
|
|
16
|
+
"web3.js",
|
|
17
|
+
"web3js",
|
|
18
|
+
"bitcoin",
|
|
19
|
+
"btc",
|
|
20
|
+
"ethereum",
|
|
21
|
+
"solana",
|
|
22
|
+
"eth",
|
|
23
|
+
"sol",
|
|
24
|
+
"blockchain",
|
|
25
|
+
"smart-contracts",
|
|
26
|
+
"dapps",
|
|
27
|
+
"dapp",
|
|
28
|
+
"dapp-tools",
|
|
29
|
+
"dapp-tool",
|
|
30
|
+
"dapp-toolkit",
|
|
31
|
+
"dapp-toolkit-cli"
|
|
32
|
+
],
|
|
33
|
+
"bin": {
|
|
34
|
+
"smb": "lib/index.js"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"lib",
|
|
38
|
+
"README.md"
|
|
39
|
+
],
|
|
40
|
+
"description": "A CLI for accessing the smbCloud platform.",
|
|
41
|
+
"license": "Apache-2.0",
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/smbcloudXYZ/smbcloud-cli.git"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"typecheck": "tsc --noEmit",
|
|
48
|
+
"lint": "eslint .",
|
|
49
|
+
"lint:fix": "eslint . --fix",
|
|
50
|
+
"build": "tsc",
|
|
51
|
+
"dev": "npm run build && node lib/index.js"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "^18.15.11",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
|
56
|
+
"@typescript-eslint/parser": "^5.48.0",
|
|
57
|
+
"eslint": "^8.31.0",
|
|
58
|
+
"typescript": "^5.0.0"
|
|
59
|
+
},
|
|
60
|
+
"optionalDependencies": {
|
|
61
|
+
"@smbcloud/cli-darwin-arm64": "0.3.33",
|
|
62
|
+
"@smbcloud/cli-darwin-x64": "0.3.33",
|
|
63
|
+
"@smbcloud/cli-linux-x64": "0.3.33",
|
|
64
|
+
"@smbcloud/cli-windows-arm64": "0.3.33",
|
|
65
|
+
"@smbcloud/cli-windows-x64": "0.3.33"
|
|
66
|
+
}
|
|
67
|
+
}
|