How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • const colors = require('ansi-colors');
     
    colors.theme({
      danger: colors.red,
      dark: colors.dim.gray,
      disabled: colors.gray,
      em: colors.italic,
      heading: colors.bold.underline,
      info: colors.cyan,
      muted: colors.dim,
      primary: colors.blue,
      strong: colors.bold,
      success: colors.green,
      underline: colors.underline,
      warning: colors.yellow
    });
     
    // Now, we can use our custom styles alongside the built-in styles!
    // Now, we can use our custom styles alongside the built-in styles!
    console.log(colors.danger.strong.em('Error!'));
    console.log(colors.warning('Heads up!'));
    console.log(colors.info('Did you know...'));
    console.log(colors.success.bold('It worked!'));
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> colors</code></pre>
    Docs
    0
  • stream = through.obj(function (file, enc, cb) {
        
        //...
    log.info(colors.gray('Linting file ' + file.path));
        bootlint.lintHtml(file.contents.toString(), reporter, options.disabledIds);
    
        
    
        //...
    }, function (cb) {
        
        //...
    })
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>local <span class="token keyword">var</span><span class="token punctuation">)</span> stream<span class="token operator">:</span> <span class="token builtin">any</span></code></pre>
    /tschortsch/gulp-bootlint mit
    0
  • function deprecate(title, alternative, description) {
        message(title, alternative, description);
        console.log('  ' + colors.gray('More information: ' + colors.underline('http://dev.ivogabe.com/gulp-typescript-3/')));
    }
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token function">deprecate</span><span class="token punctuation">(</span><span class="token parameter">title<span class="token operator">:</span> any<span class="token punctuation">,</span> alternative<span class="token operator">:</span> any<span class="token punctuation">,</span> description<span class="token operator">:</span> any</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token keyword">void</span></code></pre>
    /ivogabe/gulp-typescript mit
    0
  • function outputStyle(str) {
        if (str) {
            return chalk.gray(" → ") + chalk.underline.bold.gray(str);
        }
        return '';
    }
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token function">outputStyle</span><span class="token punctuation">(</span><span class="token parameter">str<span class="token operator">:</span> any</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token builtin">string</span></code></pre>
    /NewFuture/miniprogram-build mit
    0
  • const colors = require('ansi-colors');
     
    colors.theme({
      danger: colors.red,
      dark: colors.dim.gray,
      disabled: colors.gray,
      em: colors.italic,
      heading: colors.bold.underline,
      info: colors.cyan,
      muted: colors.dim,
      primary: colors.blue,
      strong: colors.bold,
      success: colors.green,
      underline: colors.underline,
      warning: colors.yellow
    });
     
    // Now, we can use our custom styles alongside the built-in styles!
    // Now, we can use our custom styles alongside the built-in styles!
    console.log(colors.danger.strong.em('Error!'));
    console.log(colors.warning('Heads up!'));
    console.log(colors.info('Did you know...'));
    console.log(colors.success.bold('It worked!'));
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> colors</code></pre>
    Docs
    0
  • const colors = require('ansi-colors');
     
    colors.theme({
      danger: colors.red,
      dark: colors.dim.gray,
      disabled: colors.gray,
      em: colors.italic,
      heading: colors.bold.underline,
      info: colors.cyan,
      muted: colors.dim,
      primary: colors.blue,
      strong: colors.bold,
      success: colors.green,
      underline: colors.underline,
      warning: colors.yellow
    });
     
    // Now, we can use our custom styles alongside the built-in styles!
    // Now, we can use our custom styles alongside the built-in styles!
    console.log(colors.danger.strong.em('Error!'));
    console.log(colors.warning('Heads up!'));
    console.log(colors.info('Did you know...'));
    console.log(colors.success.bold('It worked!'));
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> colors</code></pre>
    Docs
    0
  • const c = require('ansi-colors');
     
    // disable colors manually
    // disable colors manually
    c.enabled = false;
     
    // or use a library to automatically detect support
    // or use a library to automatically detect support
    c.enabled = require('color-support').hasBasic;
     
    console.log(c.red('I will only be colored red if the terminal supports colors'));
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> c</code></pre>
    Docs
    0
  • const copyTask = () => copy(v.sourceFiles, path.resolve(v.destinationFolder), {
                cwd: v.sourceFolder,
                parents: true
            }).then((res) => {
                if (res.length > 0) {
                    log(colors.white('Copied ' + v.title + ': ' + colors.magenta(res.length)));
                }
            }).catch((err) => {
                // throw error to console
                log(colors.bold(colors.red(err.name + ': ' + err.message)));
            });
    
            
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> copyTask<span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token builtin">Promise</span><span class="token operator">&lt;</span><span class="token keyword">void</span><span class="token operator">></span><span class="token punctuation">;</span> displayName<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre>
    /stevygee/master-builder MIT
    0
  • const PLUMBER_OPTIONS = {
        errorHandler(err) {
            log('Filename: ', colors.bold(colors.red(err.filename)));
            log('Linenumber: ', colors.bold(colors.red(err.line)));
            log('Extract: ', colors.bold(colors.red(err.msg)));
            this.emit('end');
        }
    };
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> <span class="token constant">PLUMBER_OPTIONS</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token function">errorHandler</span><span class="token punctuation">(</span>err<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre>
    /kraftvaerk/generator-rammevaerk mit
    0
  • const PLUMBER_OPTIONS = {
        errorHandler: function (err) {
            log(colors.bold(colors.red(err.messageFormatted)));
            this.emit('end');
        }
    };
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> <span class="token constant">PLUMBER_OPTIONS</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token function-variable function">errorHandler</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token parameter">err<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token keyword">void</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre>
    /kraftvaerk/generator-rammevaerk mit
    0
  • const c = require('ansi-colors');
     
    console.log(c.red('This is a red string!'));
    console.log(c.green('This is a red string!'));
    console.log(c.cyan('This is a cyan string!'));
    console.log(c.yellow('This is a yellow string!'));
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> c</code></pre>
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples