{"_id":"@appswap/electron-native-utils","_rev":"7-cbd027c6078249154744d6702e20283b","name":"@appswap/electron-native-utils","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"@appswap/electron-native-utils","version":"1.0.0","keywords":["electron","native","drag","windows","linux","macos","addon","click-drag"],"author":{"name":"AppSwap Team"},"license":"MIT","_id":"@appswap/electron-native-utils@1.0.0","maintainers":[{"name":"lam0x86","email":"lam0x86@gmail.com"}],"homepage":"https://github.com/app-swap/electron-native-utils#readme","bugs":{"url":"https://github.com/app-swap/electron-native-utils/issues"},"dist":{"shasum":"236d2864eee840c1ff0b7aa7ec56aa64ddf28689","tarball":"https://registry.npmjs.org/@appswap/electron-native-utils/-/electron-native-utils-1.0.0.tgz","fileCount":5,"integrity":"sha512-+YSxxRy9ciKBukNXQa69rJVDf/rFXVX6DCNVSH686QLspkPgI8ln1TzBgzttVrl8DCCwZRZE5DHG9smAzff8jA==","signatures":[{"sig":"MEYCIQDsG/+leWh69YGHKI0WdpnFQtTgVE1bdz6kIS0UDR4b4AIhAMJGC0MDeF3PbJVPNEXUp5t63ljxLFglOdv49uFKA3P/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5833},"main":"index.js","types":"index.d.ts","gitHead":"92ed6fe130c75061c708f7284c92d3e98ee18efa","scripts":{"test":"electron test/main.js","install":"node -e \"console.log('Using prebuilt @appswap/electron-native-utils binary')\""},"_npmUser":{"name":"lam0x86","email":"lam0x86@gmail.com"},"repository":{"url":"git+https://github.com/app-swap/electron-native-utils.git","type":"git"},"_npmVersion":"10.8.2","description":"A native Electron plugin for with various utilities (Windows + Linux + macOS)","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"electron":"^37.2.6","node-addon-api":"^8.5.0"},"_npmOperationalInternal":{"tmp":"tmp/electron-native-utils_1.0.0_1755443522422_0.15505623830031512","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@appswap/electron-native-utils","version":"1.0.1","keywords":["electron","native","drag","windows","linux","macos","addon","click-drag"],"author":{"name":"AppSwap Team"},"license":"MIT","_id":"@appswap/electron-native-utils@1.0.1","maintainers":[{"name":"lam0x86","email":"lam0x86@gmail.com"}],"homepage":"https://github.com/app-swap/electron-native-utils#readme","bugs":{"url":"https://github.com/app-swap/electron-native-utils/issues"},"dist":{"shasum":"8a75311c042a21d24e618f7e7380f70b1a0835d2","tarball":"https://registry.npmjs.org/@appswap/electron-native-utils/-/electron-native-utils-1.0.1.tgz","fileCount":14,"integrity":"sha512-CZzN1DnfceEL/jwHQXk467RCHLIDTSE6lpA7X35LvvbnqaZUdErdCAg20BeNr0HG17ia5lsa+BOdPpc7wfY5Qw==","signatures":[{"sig":"MEUCIQDREcjtcKUerisHkRWwrVqAWknwqOuImbYxxKNglVRcTwIgbLzNL4I8fY5zfzE5s1yYfJU8GoJ65gTd8W0roK7Hcho=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":153066},"main":"index.js","types":"index.d.ts","gitHead":"9aef3f43424c3a0627753eb8475d5826aa2282f5","scripts":{"test":"electron test/main.js","install":"node install.js"},"_npmUser":{"name":"lam0x86","email":"lam0x86@gmail.com"},"repository":{"url":"git+https://github.com/app-swap/electron-native-utils.git","type":"git"},"_npmVersion":"10.8.2","description":"A native Electron plugin for with various utilities (Windows + Linux + macOS)","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"electron":"^37.2.6","node-addon-api":"^8.5.0"},"_npmOperationalInternal":{"tmp":"tmp/electron-native-utils_1.0.1_1755444574753_0.5076953754758853","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@appswap/electron-native-utils","version":"1.0.2","keywords":["electron","native","drag","windows","linux","macos","addon","click-drag"],"author":{"name":"AppSwap Team"},"license":"MIT","_id":"@appswap/electron-native-utils@1.0.2","maintainers":[{"name":"lam0x86","email":"lam0x86@gmail.com"}],"homepage":"https://github.com/app-swap/electron-native-utils#readme","bugs":{"url":"https://github.com/app-swap/electron-native-utils/issues"},"dist":{"shasum":"067ff9c38e427dc0aab7fd1e8e8b45c92cff0b34","tarball":"https://registry.npmjs.org/@appswap/electron-native-utils/-/electron-native-utils-1.0.2.tgz","fileCount":14,"integrity":"sha512-39fpoLQF6fjok/i/FTcz+VSpe0PWTRARmdE9A7RVfHb7mJJ3x09bkePspSNVmLbEGaHrVeAiaDgSJphCh8hrVA==","signatures":[{"sig":"MEUCIC9IGr7wFkZmg5oI8aAS8nrZm2FpdYj3G/eSJRxTBAlYAiEAwNnLod2VktyhvOJOlMEj1+XqqLCAnEaLSdvPap9DP8I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":153066},"main":"index.js","types":"index.d.ts","gitHead":"5933995bd5e749ca99271434fe1b3dd9ef45bf6c","scripts":{"test":"electron test/main.js","install":"node install.js"},"_npmUser":{"name":"lam0x86","email":"lam0x86@gmail.com"},"repository":{"url":"git+https://github.com/app-swap/electron-native-utils.git","type":"git"},"_npmVersion":"10.8.2","description":"A native Electron plugin for with various utilities (Windows + Linux + macOS)","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"electron":"^37.2.6","node-addon-api":"^8.5.0"},"_npmOperationalInternal":{"tmp":"tmp/electron-native-utils_1.0.2_1755445029895_0.2608036936599982","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@appswap/electron-native-utils","version":"1.0.3","keywords":["electron","native","drag","windows","linux","macos","addon","click-drag"],"author":{"name":"AppSwap Team"},"license":"MIT","_id":"@appswap/electron-native-utils@1.0.3","maintainers":[{"name":"lam0x86","email":"lam0x86@gmail.com"}],"homepage":"https://github.com/app-swap/electron-native-utils#readme","bugs":{"url":"https://github.com/app-swap/electron-native-utils/issues"},"dist":{"shasum":"98e5fe42ed4cce8ef3bf87f971a8c58fe366ab14","tarball":"https://registry.npmjs.org/@appswap/electron-native-utils/-/electron-native-utils-1.0.3.tgz","fileCount":19,"integrity":"sha512-YOiFuwPjt1Hh9JjctP3txr2cnkLeTLrnkEI/yJyEvxWMv5XWqmYrXY40G1V6NGpB7o6Y/UAd71X3eh8SM90UhQ==","signatures":[{"sig":"MEQCIHGJKdeTKY1JZl96JCm37k4iVFvthzgtEaZAPdtNK+qNAiBow3RXM5rV+38DmbzatGEocuTJmDXpUUKftUFBsTVhyA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":603550},"main":"index.js","types":"index.d.ts","gitHead":"3712b98443deaa055e977929df17d994af7d5063","scripts":{"test":"electron test/main.js","install":"node install.js"},"_npmUser":{"name":"lam0x86","email":"lam0x86@gmail.com"},"repository":{"url":"git+https://github.com/app-swap/electron-native-utils.git","type":"git"},"_npmVersion":"10.8.2","description":"A native Electron plugin for with various utilities (Windows + Linux + macOS)","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"electron":"^37.2.6","node-addon-api":"^8.5.0"},"_npmOperationalInternal":{"tmp":"tmp/electron-native-utils_1.0.3_1755446266274_0.3898215758047763","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@appswap/electron-native-utils","version":"1.0.4","keywords":["electron","native","drag","windows","linux","macos","addon","click-drag"],"author":{"name":"AppSwap Team"},"license":"MIT","_id":"@appswap/electron-native-utils@1.0.4","maintainers":[{"name":"lam0x86","email":"lam0x86@gmail.com"}],"homepage":"https://github.com/app-swap/electron-native-utils#readme","bugs":{"url":"https://github.com/app-swap/electron-native-utils/issues"},"dist":{"shasum":"ec1fde0431ba11566f32ed74b2fa92e5bd25b827","tarball":"https://registry.npmjs.org/@appswap/electron-native-utils/-/electron-native-utils-1.0.4.tgz","fileCount":19,"integrity":"sha512-E6PAMFrkuDNzpCMOj1TkXF2KxXJdi2ZmZJfAWSDPDn4w3yJBsZhbK0SAIj0tcxCBCWXoqDsNdcE+vqMMKW4zrw==","signatures":[{"sig":"MEYCIQCcCA6SmjKFN0j2EmrReJj+51R2UYqroAE9S3ZeTn0LbgIhAMZKqRaf1N58lguE4F35RUd7VmP2kr4PWlrUP/A2Zddk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":653326},"main":"index.js","types":"index.d.ts","gitHead":"c5692da71f8b69bbc6aae9d5f26521d9ac60b4ee","scripts":{"test":"electron test/main.js","install":"node install.js"},"_npmUser":{"name":"lam0x86","email":"lam0x86@gmail.com"},"repository":{"url":"git+https://github.com/app-swap/electron-native-utils.git","type":"git"},"_npmVersion":"10.8.2","description":"A native Electron plugin for with various utilities (Windows + Linux + macOS)","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"electron":"^37.2.6","node-addon-api":"^8.5.0"},"_npmOperationalInternal":{"tmp":"tmp/electron-native-utils_1.0.4_1755459116581_0.30612407082544335","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@appswap/electron-native-utils","version":"1.0.5","keywords":["electron","native","drag","windows","linux","macos","addon","click-drag"],"author":{"name":"AppSwap Team"},"license":"MIT","_id":"@appswap/electron-native-utils@1.0.5","maintainers":[{"name":"lam0x86","email":"lam0x86@gmail.com"}],"homepage":"https://github.com/app-swap/electron-native-utils#readme","bugs":{"url":"https://github.com/app-swap/electron-native-utils/issues"},"dist":{"shasum":"1dad14647ffb0bbb18e13656c8360ba6c286a042","tarball":"https://registry.npmjs.org/@appswap/electron-native-utils/-/electron-native-utils-1.0.5.tgz","fileCount":11,"integrity":"sha512-lm8501iiaEaYGwdwYs1do3wbaN2KZ+tcCXMMKalb0O6PI9eDGSyyKSyH7LE5dWGyuZlnqFHYIUTQk4PZhPH+IA==","signatures":[{"sig":"MEQCIGpz2ZdNO/YGpxwPzn67OdZw7KhEhXTIjsWq0hBS1synAiBCtkqIDxleqctGEeWlBUvIkPjqAH9HavNiCHsm2Hw2Mw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":626168},"main":"index.js","types":"index.d.ts","gitHead":"84cad96b248a415576a03050edefe411df089a72","gypfile":true,"scripts":{"test":"electron test/main.js","install":"node-gyp rebuild"},"_npmUser":{"name":"lam0x86","email":"lam0x86@gmail.com"},"repository":{"url":"git+https://github.com/app-swap/electron-native-utils.git","type":"git"},"_npmVersion":"10.8.2","description":"A native Electron plugin for with various utilities (Windows + Linux + macOS)","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"electron":"^37.2.6","node-addon-api":"^8.5.0"},"_npmOperationalInternal":{"tmp":"tmp/electron-native-utils_1.0.5_1755459509888_0.03722618005662581","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@appswap/electron-native-utils","version":"1.0.6","description":"A native Electron plugin for with various utilities (Windows + Linux + macOS)","main":"index.js","types":"index.d.ts","author":{"name":"AppSwap Team"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/app-swap/electron-native-utils.git"},"keywords":["electron","native","drag","windows","linux","macos","addon","click-drag"],"scripts":{"test":"electron test/main.js","install":"node-gyp rebuild"},"devDependencies":{"electron":"^37.2.6","node-addon-api":"^8.5.0"},"_id":"@appswap/electron-native-utils@1.0.6","gypfile":true,"gitHead":"9a83a47fe44f0dbe1b8a182a78999945be04fbb4","bugs":{"url":"https://github.com/app-swap/electron-native-utils/issues"},"homepage":"https://github.com/app-swap/electron-native-utils#readme","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-4feCgGZkVnp2natogLgi3kfbSb8KIFZQz7LKBelRkCuL4rfL5mJVG7K9JzTLN4iD4kzRFfez7wYHKjuOy1LsSA==","shasum":"e1282e91c60bbbd265681e11d1da94ae51ece5b7","tarball":"https://registry.npmjs.org/@appswap/electron-native-utils/-/electron-native-utils-1.0.6.tgz","fileCount":11,"unpackedSize":706184,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBbZKeINsn3g66lcsecHeXybTE/VLxR/e3+bF185Uc99AiAdPfMz+zXkcdBvW6zFy4XOwMRC2aEBMagKMUYOw47XNg=="}]},"_npmUser":{"name":"lam0x86","email":"lam0x86@gmail.com"},"directories":{},"maintainers":[{"name":"lam0x86","email":"lam0x86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/electron-native-utils_1.0.6_1755460628881_0.1162816320930613"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-17T15:12:02.342Z","modified":"2025-08-17T19:57:09.317Z","1.0.0":"2025-08-17T15:12:02.609Z","1.0.1":"2025-08-17T15:29:34.961Z","1.0.2":"2025-08-17T15:37:10.114Z","1.0.3":"2025-08-17T15:57:46.543Z","1.0.4":"2025-08-17T19:31:56.787Z","1.0.5":"2025-08-17T19:38:30.144Z","1.0.6":"2025-08-17T19:57:09.127Z"},"bugs":{"url":"https://github.com/app-swap/electron-native-utils/issues"},"author":{"name":"AppSwap Team"},"license":"MIT","homepage":"https://github.com/app-swap/electron-native-utils#readme","keywords":["electron","native","drag","windows","linux","macos","addon","click-drag"],"repository":{"type":"git","url":"git+https://github.com/app-swap/electron-native-utils.git"},"description":"A native Electron plugin for with various utilities (Windows + Linux + macOS)","maintainers":[{"name":"lam0x86","email":"lam0x86@gmail.com"}],"readme":"# @appswap/electron-native-utils\nA native Node.js addon. Highly inspired by https://github.com/noobfromph/electron-click-drag-plugin\n\n## 📦 Installation\nInstall the prebuilt binary from npm (recommended):\n\n```bash\nnpm install @appswap/electron-native-utils\n```\n## 🛠 Build from source\nIf you prefer or need to compile yourself (e.g., for a different Electron version):\n\n```bash\nnpm install node-addon-api electron --save\nnpx node-gyp configure\nnpx node-gyp build\n```\nThis will compile the native addon into ./build/Release/utils.node.\n\n### 🚀 Usage\nIn your Electron preload or main process:\n\n```js\nconst { app, BrowserWindow, ipcMain } = require('electron');\nconst addon = require('@appswap/electron-native-utils'); // Loads the native addon\n\napp.whenReady().then(() => {\n  const win = new BrowserWindow({\n    width: 800,\n    height: 800,\n    frame: false, // Important: no OS window frame\n    webPreferences: {\n      nodeIntegration: true,\n      contextIsolation: false, // only for test/dev\n      devTools: true\n    },\n  });\n\n  win.loadFile('index.html');\n  win.webContents.openDevTools();\n\n  ipcMain.on('start-drag', (event, x, y) => {\n    try {\n      const hwndBuffer = win.getNativeWindowHandle();\n      // Pass the native handle Buffer directly on all platforms\n      // Optionally provide client coords (x, y) of the mousedown.\n      addon.startDrag(hwndBuffer, x, y);\n    } catch (error) {\n      console.error(error);\n    }\n  });\n});\n```\n### ✅ Tested On\nWindows 10 / 11, Linux (Fedora), macOS (15.6 M1)\n\nStandard Electron (>= v22)\n\n## Additional API\n\n### showURL(url: string, side?: 'left'|'right', maxWidth?: number)\nDisplays a small transient popup with the given URL near the bottom-left of the active window.\n\n- macOS: implemented with a borderless NSPanel, auto-dismisses after ~2.5s.\n- Windows: implemented with a small topmost popup window, auto-dismisses.\n- Linux: currently a no-op placeholder to maintain API parity.\n\nSignatures\n- startDrag(windowHandle: Buffer, x?: number, y?: number)\n- showURL(windowHandle: Buffer, url: string, side?: 'left'|'right', maxWidth?: number)\n- hideURL(windowHandle: Buffer)\n\nNotes\n- macOS ShowURL doesn’t add a child window anymore, so it won’t raise the parent window when shown.\n\n### 📜 License\nMIT","readmeFilename":"README.md"}