https://github.com/roccomuso/nc-wrapper
Node.js wrapper to the netcat util with fallbacks.
https://github.com/roccomuso/nc-wrapper
fallbacks native nc netcat nodejs socket tcp udp util wrapper
Last synced: 4 months ago
JSON representation
Node.js wrapper to the netcat util with fallbacks.
- Host: GitHub
- URL: https://github.com/roccomuso/nc-wrapper
- Owner: roccomuso
- Created: 2017-05-08T19:44:17.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-20T18:01:49.000Z (about 8 years ago)
- Last Synced: 2025-02-22T23:08:37.017Z (5 months ago)
- Topics: fallbacks, native, nc, netcat, nodejs, socket, tcp, udp, util, wrapper
- Language: JavaScript
- Size: 30.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nc-wrapper [](https://www.npmjs.com/package/nc-wrapper) [](https://standardjs.com)
> Use netcat everywhere, with fallback support.
Cross-platform. Supports: macOS, Windows, Linux, OpenBSD, FreeBSD.
See also the full node.js implementation of [netcat](https://github.com/roccomuso/nc).
| OS | Supported |
|-------|--------------------|
| Linux | :white_check_mark: |
| Mac OS | :white_check_mark: |
| Windows | :white_check_mark: |## Install
$ npm i -g nc-wrapper
## Usage `ncw`
| Server side | Client side |
|---------------------|------------------------------------|
| `ncw -l -p 2389` | `ncw localhost 2389` |By default on Linux and Windows will use the embedded binaries and the global installed ones only on exception raised.
On MacOS will try to use only the global `nc` if available.
**Known issue**. The process exit is handled as exception so it will enter into the `catch` block and spawn the fallback. I'm still looking for an elegant way to handle this.
### Other example
Easily transfer a file:
| Server side | Client side |
|---------------------|------------------------------------|
| `ncw -l 2389 > test` |cat testfile | ncw localhost 2389
|## Author
Rocco Musolino ([@roccomuso](https://twitter.com/roccomuso))