
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
[sudo] npm install hook.io -g
If you are impatient and wish to jump straight to code, we have hundreds of code examples available here: https://github.com/hookio/hook.io/tree/master/examples
hook
binaryhook.io works well as both the hook
binary or required and used programmatically through node.js
To use the hook
binary simple type this on your terminal:
hook
This will start up your first hook!
To execute this same action programtically we would create a myhook.js file that contained:
var hookio = require('hook.io'),
hook = hookio.createHook();
hook.start();
The hook repl provides an easy way to interact with a live hook.io mesh.
Simply type:
hook --repl
repl img here
Note: This is only one, small, example.
To see all other supported types of hook messaging ( including EventEmitter and Callback style ), see: https://github.com/hookio/hook.io/tree/master/examples/messaging
hook a
var hookio = require('hook.io');
var hookA = hookio.createHook({
name: "a"
});
hookA.on('*::sup', function(data){
// outputs b::sup::dog
console.log(this.event + ' ' + data);
});
hookA.start();
hook b
var hookB = hookio.createHook({
name: "b"
});
hookB.on('hook::ready', function(){
hookB.emit('sup', 'dog');
});
hookB.start();
tail foo.txt -f | hook
hook.io will now emit stdin data as separate hook events
hook -p | less
Using the -p
option, hook.io will stream events to stdout as \n
delimited JSON documents. Each document represents a single hook event.
example stdout:
{"name":"the-hook","event":"the-hook::sup","data":{"foo":"bar"}}
Multicast DNS (mdns) is a way of using DNS programming interfaces, packet formats and operating semantics on a small network where no DNS server is running. The mDNS protocol is used by Apple's Bonjour and Linux Avahi service discovery systems. mdns is an easy way to help networked devices find each other without any prior configuration.
hook.io has built-in experimental mdns support. This is intended to work on all operating systems and is intented for a way to providezero configuration networking discovery and connection of hooks over a Local Area Network ( LAN )
IMPORTANT
Before you can use the mdns feature, you will need to install a few additional dependencies.
npm install mdns@0.0.4
MacOS and Windows should work out of the box. If you are running Linux, you may need to install the following libraries.
apt-get install libavahi-compat-libdnssd-dev
using mdns
Computer 1
hookio -m
Computer 2
hookio -m
Now these two computers ( connected over a LAN, with no central DNS server ) will automatically discovery each other and begin to transmit messages. Think of the possibilities!
Wiki: https://github.com/hookio/hook.io/wiki/Hook.io-Libraries
You can also search http://search.npmjs.org/ for "hook.io" ( although there are so many matches already, the search interface can't display them all.. )
All tests are written with vows and require that you link hook.io to itself:
$ cd /path/to/hook.io
$ [sudo] npm link
$ [sudo] npm link hook.io
$ npm test
Copyright (c) Nodejitsu
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unknown package
The npm package hook.io receives a total of 5 weekly downloads. As such, hook.io popularity was classified as not popular.
We found that hook.io demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.