ckn.stream
v3.1.20
Published
CKN Framework to manage and process data
Downloads
392
Readme
CKN Stream
CKN Framework is framework for Javascript to support both of backend and frontend. It helps us to develop microservice model easier. And it helps to manage 3rd parties library. CKN Stream is library to manage data including database management, files management.
Installation
CKN Stream is public npm package on NPM registry. Before install package, need to install Node.js version 18.0 or higher.
npm install ckn.stream
Database Management
It is a tool that helps manage data in the database. CKN.Stream can support various databases such as PostgreSQL, SQL Server, or MySQL, and more.
Database Management - PostgreSQL
Begin with, it need to inherit class from Postgresql class like below example.
import { Postgresql } from "ckn.stream";
export class TestDatabase extends Postgresql {
constructor() {
super();
this.host = '<Database Server Address>';
this.user = '<Database User Name>' ;
this.password = '<Database Password>' ;
this.database = '<Database Name>';
this.schema = '<Database Schema>'; // Such as 'public'
}
}
You can bind configuration to Environment Variable as below example.
import { Postgresql } from "ckn.stream";
export class TestDatabase extends Postgresql {
constructor() {
super();
this.host = process.env.DB_HOST ;
this.user = process.env.DB_USER ;
this.password = process.env.DB_PASSWORD ;
this.database = process.env.DB_DATABASE;
this.schema = process.env.DB_SCHEMA;
}
}