btwiuse 0.0.6

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 +16 -0
  2. package/index.js +58 -0
  3. package/package.json +25 -0
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # btw i use ...
2
+
3
+ a collection of `curl | bash` style one-liners for installing common tools
4
+
5
+ ```
6
+ npx btwiuse [pkg]
7
+ ```
8
+
9
+ possible values of pkg:
10
+
11
+ - asdf
12
+ - deno
13
+ - rustup
14
+ - golang
15
+ - code-server
16
+ - ...
package/index.js ADDED
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+
3
+ var child_process = require("child_process");
4
+
5
+ const Map = {
6
+ deno: {
7
+ install: "curl -fsSL https://deno.land/install.sh | sh",
8
+ powershell: "iwr https://deno.land/install.ps1 -useb | iex",
9
+ },
10
+ "code-server": {
11
+ install: "wget -O- https://aka.ms/install-vscode-server/setup.sh | sh",
12
+ },
13
+ asdf: {
14
+ install: "iwr https://deno.land/install.ps1 -useb | iex",
15
+ path: ". $HOME/.asdf/asdf.sh",
16
+ completion: ". $HOME/.asdf/completions/asdf.bash",
17
+ },
18
+ pd: "install pd",
19
+ golang: {
20
+ "desc": "install golang",
21
+ "install": "go install golang.org/dl/go1.19rc1@latest",
22
+ "download": "go1.19rc1 download",
23
+ },
24
+ rustup: {
25
+ desc: "install rustup",
26
+ install: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh",
27
+ },
28
+ dkg: "install dkg",
29
+ bun: {
30
+ "install": "curl https://bun.sh/install | bash",
31
+ "source": `BUN_INSTALL="$HOME/.bun"; export PATH="$BUN_INSTALL/bin:$PATH"`,
32
+ },
33
+ wasmedge: {
34
+ "install":
35
+ "curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash",
36
+ "source": "source $HOME/.wasmedge/env",
37
+ },
38
+ };
39
+
40
+ const args = process.argv.slice(2);
41
+
42
+ // console.log(args)
43
+
44
+ function find(map, x) {
45
+ if (x.length == 0) return map;
46
+ if (x[0] in map) return find(map[x[0]], x.slice(1));
47
+ console.log(`not found:`, x);
48
+ console.log("expected:", JSON.stringify(map, null, " "));
49
+ }
50
+
51
+ console.log(find(Map, args));
52
+
53
+ /*
54
+ child_process.spawnSync("sh", [
55
+ "-c",
56
+ `echo ${process.argv}`,
57
+ ], { stdio: "inherit" });
58
+ */
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "btwiuse",
3
+ "version": "0.0.6",
4
+ "bin": {
5
+ "btwiuse": "index.js"
6
+ },
7
+ "description": "collection of `curl | bash` install scripts",
8
+ "main": "index.js",
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/btwiuse/btwiuse.git"
15
+ },
16
+ "keywords": [
17
+ "btwiuse"
18
+ ],
19
+ "author": "btwiuse",
20
+ "license": "MIT",
21
+ "bugs": {
22
+ "url": "https://github.com/btwiuse/btwiuse/issues"
23
+ },
24
+ "homepage": "https://github.com/btwiuse/btwiuse#readme"
25
+ }