How to use the draftlog function in draftlog

To help you get started, we’ve selected a few draftlog examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpenBazaar / openbazaar-desktop / bin / getCryptoData.js View on Github external
import path from 'path';
import fetch from 'node-fetch';
import Promise from 'bluebird';
import fs from 'fs';
import jsonformat from 'json-format';
import draftLog from 'draftlog';

const iconOutputPath = `${__dirname}${path.sep}..${path.sep}imgs${path.sep}cryptoIcons${path.sep}/`;
const translationFile = `${__dirname}${path.sep}..${path.sep}js${path.sep}` +
  `languages${path.sep}/en_US.json`;

draftLog(console);

let whitelist = {};

/*
 * The whitelist is obtained from the ticker. It is a mapping of currency code
 * to CMC id. In the event of duplicate crypto currency codes the CMC id listed in
 * the whitelist will be used. For dupes not listed, the first one in the results
 * set obtained from CMC will be used (which is likely the one that was
 * listed with CMC the longest).
 */
function getWhitelist() {
  return new Promise((resolve, reject) => {
    fetch('https://ticker.openbazaar.org/whitelist')
      .then(res => resolve(res.json()))
      .catch(err => reject(err));
  });
github marvin-js / marvin / src / lib / log.js View on Github external
import Draftlog from 'draftlog';
import chalk from 'chalk';

Draftlog(console);

export const info = (...args) => `${chalk.bgBlue(' INFO ')}: ${args.join(' ')}`;

export const warn = (...args) => `${chalk.keyword('orange').inverse(' WARN ')}: ${args.join(' ')}`;

export const erro = (...args) => `${chalk.bgRed(' ERRO ')}: ${args.join(' ')}`;

export default console;

draftlog

Create updatable log lines into the terminal, and give life to your logs!

MIT
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis

Popular draftlog functions