How to use the log-symbols.hasOwnProperty function in log-symbols

To help you get started, we’ve selected a few log-symbols 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 update / update / lib / rename.js View on Github external
'use strict';

var fs = require('fs');
var path = require('path');
var chalk = require('chalk');
var symbol = require('log-symbols');
var bold = chalk.bold;

for (var key in symbol) {
  if (symbol.hasOwnProperty(key)) {
    symbol[key] = '  ' + symbol[key] + ' ';
  }
}

module.exports = function rename(src, dest, opts) {
  opts = opts || {};

  if (path.resolve(src) === path.resolve(dest)) {
    if (opts.silent !== true) {
      console.log(symbol.warning, bold(src), 'and', bold(dest), 'are the same path.');
    }
  } else if (!fs.existsSync(src)) {
    if (opts.silent !== true) {
      console.log(symbol.error, bold(src), 'does not exist.');
    }
  } else if (fs.existsSync(dest) && opts.force !== true) {

log-symbols

Colored symbols for various log levels. Example: `✔︎ Success`

MIT
Latest version published 7 months ago

Package Health Score

78 / 100
Full package analysis