0.1.12 • Published 2 years ago
@juniper-tech/core v0.1.12
@juniper-tech/core
Usage
... work in progress
Kafka Topic Consumption
We use kafkajs in the core library to generate and process messages in topics.
import { JuniperKafka, JuniperConsumer } from '@juniper-tech/core'
const kafka = JuniperKafka(process.env.KAFKA_BROKERS || '', 'juniper-ingest-client', 2)
const consumer = await JuniperConsumer(kafka, 'nodejs-dev', null)
Sensor Model Interaction
We use sequelize to interact with tables and have conveniently abstracted out the model creation so you can import into your own package.
// Sequelize connection is the sequelize instance of your db
import SequelizeConnection from '../sequelize-connection'
import { SensorModel } from '@juniper-tech/core'
let sensorPg = SensorModel(DB)
// this is now a standard sequelize model and can be used like one
sensorPg.bulkCreate(data as any).catch((err:any) => {
console.error('error', err)
})
0.1.10
2 years ago
0.1.12
2 years ago
0.1.0
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.8
2 years ago
0.1.9
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago