Sign In

k-toolbelt

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

k-toolbelt

Combination of various node tools used for quick prototyping

latest
Source
npmnpm
Version
4.0.0
Version published
Maintainers
1
Created
Source

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');


Keywords

logging

FAQs

Package last updated on 11 Jan 2018

Did you know?

Socket

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.

Install

Related posts