How to use the fancy-log function in fancy-log

To help you get started, we’ve selected a few fancy-log 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 olefredrik / FoundationPress / gulpfile.babel.js View on Github external
if (checkFileExists('config.yml')) {
    // config.yml exists, load it
    log(colors.bold(colors.cyan('config.yml')), 'exists, loading', colors.bold(colors.cyan('config.yml')));
    let ymlFile = fs.readFileSync('config.yml', 'utf8');
    return yaml.load(ymlFile);

  } else if(checkFileExists('config-default.yml')) {
    // config-default.yml exists, load it
    log(colors.bold(colors.cyan('config.yml')), 'does not exist, loading', colors.bold(colors.cyan('config-default.yml')));
    let ymlFile = fs.readFileSync('config-default.yml', 'utf8');
    return yaml.load(ymlFile);

  } else {
    // Exit if config.yml & config-default.yml do not exist
    log('Exiting process, no config file exists.');
    log('Error Code:', err.code);
    process.exit(1);
  }
}
github appium / appium / commands-yml / parse.js View on Github external
}

  const commandTemplate = Handlebars.compile(await fs.readFile(path.resolve(rootFolder, 'commands-yml', 'api-template.md'), 'utf8'), {noEscape: true, strict: true});

  async function writeIndex (index, commands, indexPath) {
    log(`Creating API index '${index}'`);
    const commandMarkdown = commandTemplate({
      commands,
      path: indexPath,
    });
    await fs.writeFile(index, commandMarkdown, 'utf8');
  }

  const apiIndex = path.resolve(rootFolder, 'docs', 'en', 'about-appium', 'api.md');
  await writeIndex(apiIndex, commands);
  log(`Done writing main API index`);

  async function writeIndividualIndexes (command) {
    if (!util.hasValue(command.commands)) {
      // this is a leaf, so end
      return;
    }

    // write this node
    const relPath = command.path.startsWith(path.sep) ? command.path.substring(1) : command.path;
    const index = path.resolve(rootFolder, relPath, 'README.md');
    await writeIndex(index, command.commands, command.path);

    // go through all the sub-commands
    for (const el of command.commands) {
      await writeIndividualIndexes(el);
    }
github takanakahiko / slack-emoji-meister / tasks / styles.js View on Github external
.pipe(sass({ includePaths: ['./app'] }).on('error', function (error) {
      log(c.red('Error (' + error.plugin + '): ' + error.message))
      this.emit('end')
    }))
    .pipe(gulpif(args.production, cleanCSS()))
github fluid-notion / fluid-outliner / electron-shell / app / src / main.ts View on Github external
mainWindow.webContents.on("did-finish-load", () => {
        log("Finished loading")
        if (!mainWindow) return
        mainWindow.show()
        mainWindow.focus()

        if (isDev) {
            log("Launching dev tools")
            mainWindow.webContents.openDevTools()
        }

        if (inputFiles.length > 0) {
            if (inputFiles.length > 1) {
                console.error("Multiple input files are currently not supported")
            }
            log("Visiting file")
            mainWindow.webContents.send("fno:visit-file", inputFiles[0])
        }
github sun-zheng-an / gulp-shell / index.ts View on Github external
const runCommand = (
  command: string,
  options: Required,
  file: Vinyl | null
): Promise => {
  const context = { file, ...options.templateData }
  command = template(command)(context)

  if (options.verbose) {
    fancyLog(`${PLUGIN_NAME}:`, chalk.cyan(command))
  }

  const child = spawn(command, {
    env: options.env,
    cwd: template(options.cwd)(context),
    shell: options.shell,
    stdio: options.quiet ? 'ignore' : 'inherit'
  })

  return new Promise((resolve, reject) => {
    child.on('exit', code => {
      if (code === 0 || options.ignoreErrors) {
        return resolve()
      }

      const context = {
github olefredrik / FoundationPress / gulpfile.babel.js View on Github external
    .on('change', path => log('File ' + colors.bold(colors.magenta(path)) + ' changed.'))
    .on('unlink', path => log('File ' + colors.bold(colors.magenta(path)) + ' was removed.'));
github Automattic / jetpack / gulpfile.babel.js View on Github external
gulp.src( [ '_inc/build/static*' ] )
				.pipe( tap( function( file ) {
					fs.unlinkSync( file.path );
				} ) )
				.on( 'end', function() {
					fs.writeFile( __dirname + '/_inc/build/static.html', window.staticHtml );
					fs.writeFile( __dirname + '/_inc/build/static-noscript-notice.html', window.noscriptNotice );
					fs.writeFile( __dirname + '/_inc/build/static-version-notice.html', window.versionNotice );
					fs.writeFile( __dirname + '/_inc/build/static-ie-notice.html', window.ieNotice );

					if ( done ) {
						done();
					}
				} );
		} catch ( error ) {
			log( colors.yellow(
				'Warning: gulp was unable to update static HTML files.\n\n' +
				'If this is happening during watch, this warning is OK to dismiss: sometimes webpack fires watch handlers when source code is not yet built.'
			) );
		}
	} );
}
github Automattic / jetpack / gulpfile.babel.js View on Github external
.on( 'end', function() {
				log( 'Your other JS is now uglified!' );
			} );
github Automattic / jetpack / gulpfile.babel.js View on Github external
.on( 'end', function() {
					log( 'Your JS is now uglified!' );
				} );
		}
github Automattic / jetpack / tools / builder / sass.js View on Github external
.on( 'end', function() {
			log( success );
			done();
		} );
}

fancy-log

Log things, prefixed with a timestamp.

MIT
Latest version published 2 years ago

Package Health Score

73 / 100
Full package analysis