valeriansaliou/node-sonic-channel — 151★ on GitHub (JavaScript). 🦉 Sonic Channel integration for Node. Used in pair with Sonic, the fast, lightweight and schema-less search backend.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Sonic Channel integration for Node. Used in pair with Sonic, the fast, lightweight and schema-less search backend.
Sonic Channel lets you manage your Sonic search index, from your NodeJS code. Query your index and get search results, push entries to your index and pop them programmatically.
🇫🇷 Crafted in Nantes, France.
Who uses it?
Crisp
👋 You use sonic-channel and you want to be listed there? Contact me.
How to install?
Include sonic-channel in your package.json dependencies.
Alternatively, you can run npm install sonic-channel --save.
How to use?
1️⃣ Search channel
1. Create the connection
node-sonic-channel can be instanciated in search mode as such:
var SonicChannelSearch = require("sonic-channel").Search;
var sonicChannelSearch = new SonicChannelSearch({
host : "::1", // Or '127.0.0.1' if you are still using IPv4
port : 1491, // Default port is '1491'
auth : "SecretPassword" // Authentication password (if any)
}).connect({
connected : function() {
// Connected handler
console.info("Sonic Channel succeeded to connect to host (search).");
},
disconnected : function() {
// Disconnected handler
console.error("Sonic Channel is now disconnected (search).");
},
timeout : function() {
// Timeout handler
console.error("Sonic Channel connection timed out (search).");
},
retrying : function() {
// Retry handler
console.error("Trying to reconnect to Sonic Channel (search)...");
},
error : function(error) {
// Failure handler
console.error("Sonic Channel failed to connect to host (search).", error);
}
});
2. Query the search index
Use the same sonicChannelSearch instance to query the search index:
sonicChannelSearch.query("messages", "default", "valerian saliou")
.then(function(results) {
// Query results come there
})
.catch(function(error) {
// Query errors come there
});
3. Teardown connection
If you need to teardown an ongoing connection to Sonic, use:
sonicChannelSearch.close()
.then(function() {
// Close success handler
})
.catch(function(error) {
// Close errors come there
});
2️⃣ Ingest channel
1. Create the connection
node-sonic-channel can be instanciated in ingest mode as such:
var SonicChannelIngest = require("sonic-channel").Ingest;
var sonicChannelIngest = new SonicChannelIngest({
host : "::1", // Or '127.0.0.1' if you are still using IPv4
port : 1491, // Default port is '1491'
auth : "SecretPassword" // Authentication password (if any)
}).connect({
connected : function() {
// Connected handler
console.info("Sonic Channel succeeded to connect to host (ingest).");
},
disconnected : function() {
// Disconnected handler
console.error("Sonic Channel is now disconnected (ingest).");
},
timeout : function() {
// Timeout handler
console.error("Sonic Channel connection timed out (ingest).");
},
retrying : function() {
// Retry handler
console.error("Trying to reconnect to Sonic Channel (ingest)...");
},
error : function(error) {
// Failure handler
console.error("Sonic Channel failed to connect to host (ingest).", error);
}
});
2. Manage the search index
Use the same sonicChannelIngest instance to push text to the search index:
sonicChannelIngest.push("messages", "default", "conversation:1", "I met Valerian Saliou yesterday. Great fun!")
.then(function() {
// Push success handler
})
.catch(function(error) {
// Push errors come there
});
3. Teardown connection
If you need to teardown an ongoing connection to Sonic, use:
sonicChannelIngest.close()
.then(function() {
// Close success handler
})
.catch(function(error) {
// Close errors come there
});
3️⃣ Control channel
1. Create the connection
node-sonic-channel can be instanciated in control mode as such:
var SonicChannelControl = require("sonic-channel").Control;
var sonicChannelControl = new SonicChannelControl({
host : "::1", // Or '127.0.0.1' if you are still using IPv4
port : 1491, // Default port is '1491'
auth : "SecretPassword" // Authentication password (if any)
}).connect({
connected : function() {
// Connected handler
console.info("Sonic Channel succeeded to connect to host (control).");
},
disconnected : function() {
// Disconnected handler
console.error("Sonic Channel is now disconnected (control).");
},
timeout : function() {
// Timeout handler
console.error("Sonic Channel connection timed out (control).");
},
retrying : function() {
// Retry handler
console.error("Trying to reconnect to Sonic Channel (control)...");
},
error : function(error) {
// Failure handler
console.error("Sonic Channel failed to connect to host (control).", error);
}
});
2. Administrate your Sonic server
You may use the same sonicChannelControl instance to administrate your Sonic server.
3. Teardown connection
If you need to teardown an ongoing connection to Sonic, use:
sonicChannelControl.close()
.then(function() {
// Close success handler
})
.catch(function(error) {
// Close errors come there
});
List of channel methods
For details on argument values, see the Sonic Channel Protocol specification.
ℹ️ Wondering what Sonic is? Check out valeriansaliou/sonic.
How is it linked to Sonic?
node-sonic-channel maintains persistent TCP connections to the Sonic network interfaces that are listening on your running Sonic instance. In case node-sonic-channel gets disconnected from Sonic, it will retry to connect once the connection is established again.
You can configure the connection details of your Sonic instance when initializing node-sonic-channel from your code; via the Sonic host and port.
How active is development on valeriansaliou/node-sonic-channel?
The most recent commit recorded on valeriansaliou/node-sonic-channel was 21 days ago, based on the GitHub push timestamp. The repository has 7 forks — one of the better signals of community interest.
Is valeriansaliou/node-sonic-channel open source?
Yes — valeriansaliou/node-sonic-channel ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/valeriansaliou/node-sonic-channel.
What license does valeriansaliou/node-sonic-channel use?
valeriansaliou/node-sonic-channel is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
What topics is valeriansaliou/node-sonic-channel associated with?
GitHub's repository topics for valeriansaliou/node-sonic-channel: "graph", "index", "nodejs", "npm", "npm-package", "search", "sonic". TopGit's editorial category is Backend.
Where can I see valeriansaliou/node-sonic-channel in action?
The project maintains a homepage at https://www.npmjs.com/package/sonic-channel. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about valeriansaliou/node-sonic-channel?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/valeriansaliou/node-sonic-channel is the definitive source.
Read full README in the tab above.
Still deciding about node-sonic-channel?
One click hands the question to an AI along with this page — see what it says about node-sonic-channel.