4.0.0 • Published 7 years ago

k-toolbelt v4.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

k-toolbelt

Combination of various node tools used for quick prototyping

Install

npm install --save k-toolbelt

Data Sources

Postgres

import { pg } from 'k-toolbelt';

function main() {
  await pg.initDB('name1', {
    host: '',
    database: '',
    user: '',
    password: ''
  });
  
  let db = pg.getDB('name1');
  let res = await db.query(`select * from foo where id = $1`, [5]);
  res.forEach(r => console.log(r.id);)
  db.disconnect();
}

MySQL

import { mysql } from 'k-toolbelt';

function main() {
  await mysql.initDB('name1', {
     host: '',
     database: '',
     user: '',
     password: ''
  });
  
  let db = mysql.getDB('name1');
  let res = await db.query(`select * from foo where id = ?`, [5]);
  res.forEach(r => console.log(r.id);)
  db.disconnect();
}

Logging

import { log } from 'k-node-tools';
log.setLevel('debug');

log.info('foo');
log.error('bar');
4.0.0

7 years ago

3.0.3

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago