@stacksjs/tunnel 0.58.72 → 0.59.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.
- package/README.md +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +12 -3
- package/dist/tunnel.d.ts +3 -0
- package/package.json +4 -10
- package/src/index.ts +4 -2
- package/src/tunnel.ts +11 -0
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Now, you can use it in your project:
|
|
|
15
15
|
```js
|
|
16
16
|
import { createLocalTunnel } from '@stacksjs/tunnel'
|
|
17
17
|
|
|
18
|
-
const url = await createLocalTunnel(
|
|
18
|
+
const url = await createLocalTunnel(3000)
|
|
19
19
|
|
|
20
20
|
console.log('publicly sharable URL of your localhost', url)
|
|
21
21
|
```
|
package/dist/index.d.ts
ADDED
package/dist/index.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
// src/tunnel.ts
|
|
3
|
+
async function localTunnel(options) {
|
|
4
|
+
const port = 3000;
|
|
5
|
+
if (!options?.port)
|
|
6
|
+
options = { port };
|
|
7
|
+
console.log("Creating local tunnel", options.port);
|
|
8
|
+
return "localTunnel";
|
|
9
|
+
}
|
|
10
|
+
|
|
2
11
|
// src/index.ts
|
|
3
|
-
import localtunnel from "localtunnel";
|
|
4
12
|
async function createLocalTunnel(port) {
|
|
5
|
-
const
|
|
6
|
-
return
|
|
13
|
+
const tunnel2 = await localTunnel({ port });
|
|
14
|
+
return tunnel2.url;
|
|
7
15
|
}
|
|
8
16
|
export {
|
|
17
|
+
localTunnel,
|
|
9
18
|
createLocalTunnel
|
|
10
19
|
};
|
package/dist/tunnel.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/tunnel",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.59.1",
|
|
5
5
|
"description": "Local development tunnel.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"tunnel",
|
|
20
|
-
"
|
|
20
|
+
"local",
|
|
21
|
+
"bun",
|
|
21
22
|
"stacks"
|
|
22
23
|
],
|
|
23
24
|
"exports": {
|
|
@@ -45,14 +46,7 @@
|
|
|
45
46
|
"typecheck": "bun --bun tsc --noEmit",
|
|
46
47
|
"prepublishOnly": "bun --bun run build"
|
|
47
48
|
},
|
|
48
|
-
"peerDependencies": {
|
|
49
|
-
"localtunnel": "^2.0.2"
|
|
50
|
-
},
|
|
51
|
-
"dependencies": {
|
|
52
|
-
"localtunnel": "^2.0.2"
|
|
53
|
-
},
|
|
54
49
|
"devDependencies": {
|
|
55
|
-
"@stacksjs/development": "latest"
|
|
56
|
-
"@types/localtunnel": "^2.0.4"
|
|
50
|
+
"@stacksjs/development": "latest"
|
|
57
51
|
}
|
|
58
52
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { localTunnel } from './tunnel'
|
|
2
2
|
|
|
3
3
|
export async function createLocalTunnel(port: number) {
|
|
4
|
-
const tunnel = await
|
|
4
|
+
const tunnel = await localTunnel({ port })
|
|
5
5
|
return tunnel.url
|
|
6
6
|
}
|
|
7
|
+
|
|
8
|
+
export { localTunnel }
|
package/src/tunnel.ts
ADDED