How to use the colors-cli/safe.red_b function in colors-cli

To help you get started, we’ve selected a few colors-cli 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 jaywcjlove / mocker-api / src / index.js View on Github external
watcher.on('all', (event, path) => {
    if (event === 'change' || event === 'add') {
      try {
        // 当监听的可能是多个配置文件时,需要清理掉更新文件以及入口文件的缓存,重新获取
        cleanCache(path);
        watchFiles.forEach(file => cleanCache(file));
        mocker = getConfig();
        console.log(`${color.green_b.black(' Done: ')} Hot Mocker ${color.green(path.replace(process.cwd(), ''))} file replacement success!`);
      } catch (ex) {
        console.error(`${color.red_b.black(' Failed: ')} Hot Mocker ${color.red(path.replace(process.cwd(), ''))} file replacement failed!!`);
      }
    }
  })
  // 监听文件修改重新加载代码