
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
vmetrics-js
Advanced tools
High-performance TypeScript client for VictoriaMetrics with automatic batching and buffering
A high-performance TypeScript/JavaScript client for VictoriaMetrics, optimized for IoT and high-throughput time-series data ingestion.
⚠️ EARLY STAGE PROJECT - NOT PRODUCTION READY
This project is in very early development and should NOT be used in production environments yet. Currently, only a rudimentary push API is implemented. Many features are missing, and the API may change significantly. Use at your own risk!
Project Focus: We are concentrating on the push API (actively sending metrics to VictoriaMetrics). For exposing a
/metricsendpoint that VictoriaMetrics can scrape (pull API), use prom-client instead.Contributions and feedback are welcome to help make this library production-ready.
async-mutex)npm install vmetrics-js
yarn add vmetrics-js
pnpm add vmetrics-js
import { VictoriaMetricsClient } from 'vmetrics-js'
// Create a client instance
const client = new VictoriaMetricsClient({
url: 'http://0.0.0.0:8428',
batchSize: 1000, // Flush after 1000 points
flushInterval: 5000, // Flush every 5 seconds
})
// Write data points
client.writePoint({
measurement: 'temperature',
tags: {
sensor_id: 'sensor-001',
location: 'warehouse-a',
},
fields: {
value: 23.5,
humidity: 65.2,
},
timestamp: new Date(), // Optional, uses server time if omitted
})
// Graceful shutdown (flushes remaining buffer)
await client.shutdown()
client.writePoint({
measurement: 'system_stats',
tags: {
host: 'server-01',
region: 'us-east-1',
},
fields: {
cpu_usage: 45.2, // number
memory_used: 8589934592, // number (bytes)
disk_full: false, // boolean
status: 'healthy', // string
},
})
batchSizeflushIntervalflushInterval┌─────────────┐
│ Application │
└──────┬──────┘
│ writePoint()
▼
┌─────────────────┐
│ Write Buffer │◄─── Mutex Protected
└──────┬──────────┘
│
├─► Batch Size Reached? ──► Flush ───┐
└─► Time Interval? ───────► Flush ───┐
│
▼
┌─────────────────┐
│ VictoriaMetrics │
└─────────────────┘
writePoint() adds data to an in-memory buffer (instant return)batchSize OR flushInterval expiresFor local development, you can run VictoriaMetrics with Podman/Docker:
docker run -d --name victoriametrics \
-p 8428:8428 \
victoriametrics/victoria-metrics:latest
Access the UI at: http://0.0.0.0:8428
curl http://0.0.0.0:8428/health[VMClient] error logs in your consoleawait client.flush() to send data immediatelyEnsure you're using the correct authentication method:
const client = new VictoriaMetricsClient({
url: 'http://0.0.0.0:8428',
auth: { bearer: 'your-token-here' },
})
Run the test suite:
npm test
Run the example:
npm run example
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
# Clone the repository
git clone git@github.com:zimmerling/vmetrics-js.git
cd vmetrics-js
# Install dependencies
npm install
# Run tests
npm test
# Build
npm run build
# Lint
npm run lint
# Format code
npm run format
This library is in early development and currently provides only basic functionality:
What's implemented:
What's missing:
/metrics endpoint) - Use prom-client for thisThis library focuses exclusively on the push API - actively sending metrics from your application to VictoriaMetrics.
For pull-based metrics (exposing a /metrics endpoint that VictoriaMetrics scrapes), use:
Push API improvements:
Not planned (use other tools):
/metrics endpoint → Use prom-clientStar this repo if you find it useful!
FAQs
High-performance TypeScript client for VictoriaMetrics with automatic batching and buffering
We found that vmetrics-js demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.