
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
@johnpyp/clickhouse-client
Advanced tools
ClickHouse® is an open-source, high performance columnar OLAP database management system for real-time analytics using SQL.
Install the following package:
$ npm i --save @depyronick/clickhouse-client
Once the installation process is complete, you can import the ClickHouseClient
const { ClickHouseClient } = require('@depyronick/clickhouse-client');
// or:
// import { ClickHouseClient } from '@depyronick/clickhouse-client';
const analyticsServer = new ClickHouseClient({
host: '127.0.0.1',
password: '7h3ul71m473p4555w0rd'
});
// you can create multiple clients
const chatServer = new ClickHouseClient({
host: '127.0.0.2',
password: '7h3ul71m473p4555w0rd'
});
new ClickHouseClient(options: ClickHouseOptions)
will create a ClickHouse client with the specified connection options.
See ClickHouseOptions object for more information.
ClickHouseClient.query<T>(query: string): Observable<T>
this.analyticsServer.query('SELECT * FROM visits LIMIT 10').subscribe({
error: (err) => {
// called when an error occurred during query
},
next: (row) => {
// called for each row
},
complete: () => {
// called when stream is completed
}
});
ClickHouseClient.queryPromise<T>(query: string): Promise<T[]>
this.analyticsServer
.queryPromise('SELECT * FROM visits LIMIT 10')
.then((rows) => {
// all retrieved rows
})
.catch((err) => {
// called when an error occurred during query
});
// or
const rows = await this.analyticsServer.queryPromise(
'SELECT * FROM visits LIMIT 10'
);
ClickHouseClient.insert<T>(table: string, data: T[]): Observable<any>
The insert
method accepts two inputs.
table
is the name of the table that you'll be inserting data to.
analytics_db.visits
.data: T[]
array of JSON objects to insert.analyticsServer
.insert('visits', [
{
timestamp: new Date().getTime(),
ip: '127.0.0.1',
os: 'OSX',
userAgent:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/95.0.4638.69 Safari/537.36',
version: '1.0.0'
}
])
.subscribe({
error: (err) => {
// called when an error occurred during insert
},
next: () => {
// currently next does not emits anything for inserts
},
complete: () => {
// called when insert is completed
}
});
ClickHouseClient.ping(timeout: number = 3000): Promise<boolean>
The ping
method accepts one input.
timeout
is the time in milliseconds to wait for the server to send ping response Ok.\n
// if you're using async/await
const ping = await analyticsServer.ping();
// or
analyticsServer
.then((pingResult) => {
// ping result is a boolean
// it will return `true` if we were able to receive `Ok.\n`
// and `false` if anything but `Ok.\n`
})
.catch((reason) => {
// reason is the full response of the error
// see more details at https://axios-http.com/docs/handling_errors
});
FAQs
ClickHouse Client for NodeJS.
The npm package @johnpyp/clickhouse-client receives a total of 0 weekly downloads. As such, @johnpyp/clickhouse-client popularity was classified as not popular.
We found that @johnpyp/clickhouse-client 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 Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.