@saberd/nibble 0.1.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/install.js ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require('child_process');
4
+
5
+ function installNibble() {
6
+ console.log("Installing nibble using 'go install'...");
7
+ const result = spawnSync('go', ['install', 'github.com/saberd/nibble@latest'], {
8
+ stdio: 'inherit',
9
+ shell: true
10
+ });
11
+
12
+ if (result.status !== 0) {
13
+ console.error('Error installing nibble');
14
+ process.exit(1);
15
+ }
16
+
17
+ console.log('✓ Installed successfully');
18
+ }
19
+
20
+ installNibble();
21
+
package/bin/nibble.js ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync } = require('child_process');
4
+ const path = require('path');
5
+ const os = require('os');
6
+
7
+ // The Go binary is installed to $GOPATH/bin or ~/go/bin
8
+ const goBin = path.join(os.homedir(), 'go', 'bin', 'nibble');
9
+
10
+ try {
11
+ const args = process.argv.slice(2).join(' ');
12
+ execSync(`${goBin} ${args}`, { stdio: 'inherit' });
13
+ } catch (error) {
14
+ process.exit(error.status || 1);
15
+ }
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@saberd/nibble",
3
+ "version": "0.1.0",
4
+ "description": "Fast local network scanner with hardware identification and a terminal UI",
5
+ "bin": {
6
+ "nibble": "bin/nibble.js"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node bin/install.js"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/saberd/nibble.git"
14
+ },
15
+ "author": "saberd",
16
+ "license": "MIT",
17
+ "keywords": [
18
+ "network",
19
+ "scanner",
20
+ "arp",
21
+ "ports",
22
+ "cli",
23
+ "tui"
24
+ ],
25
+ "engines": {
26
+ "node": ">=12.0.0"
27
+ },
28
+ "dependencies": {
29
+ "golang": "^1.23.0"
30
+ },
31
+ "publishConfig": {
32
+ "registry": "https://registry.npmjs.org/"
33
+ }
34
+ }