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

  • import styles from 'ansi-styles';
    
    console.log(styles.codes.get(36));
    //=> 39
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> styles<span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token keyword">readonly</span> modifier<span class="token operator">:</span> Modifier<span class="token punctuation">;</span> <span class="token keyword">readonly</span> color<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> ForegroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> bgColor<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> BackgroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> codes<span class="token operator">:</span> ReadonlyMap<span class="token operator">&lt;</span><span class="token builtin">number</span><span class="token punctuation">,</span> <span class="token builtin">number</span><span class="token operator">></span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token operator">&amp;</span> ForegroundColor <span class="token operator">&amp;</span> BackgroundColor <span class="token operator">&amp;</span> Modifier <span class="token operator">&amp;</span> ConvertColor <span class="token keyword">import</span> styles</code></pre>
    Docs
    0
  • import styles from 'ansi-styles';
    
    console.log(`${styles.green.open}Hello world!${styles.green.close}`);
    
    
    // Color conversion between 256/truecolor
    // NOTE: When converting from truecolor to 256 colors, the original color
    //       may be degraded to fit the new color palette. This means terminals
    //       that do not support 16 million colors will best-match the
    //       original color.
    console.log(`${styles.color.ansi(styles.rgbToAnsi(199, 20, 250))}Hello World${styles.color.close}`)
    console.log(`${styles.color.ansi256(styles.rgbToAnsi256(199, 20, 250))}Hello World${styles.color.close}`)
    console.log(`${styles.color.ansi16m(...styles.hexToRgb('#abcdef'))}Hello World${styles.color.close}`)
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> styles<span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token keyword">readonly</span> modifier<span class="token operator">:</span> Modifier<span class="token punctuation">;</span> <span class="token keyword">readonly</span> color<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> ForegroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> bgColor<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> BackgroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> codes<span class="token operator">:</span> ReadonlyMap<span class="token operator">&lt;</span><span class="token builtin">number</span><span class="token punctuation">,</span> <span class="token builtin">number</span><span class="token operator">></span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token operator">&amp;</span> ForegroundColor <span class="token operator">&amp;</span> BackgroundColor <span class="token operator">&amp;</span> Modifier <span class="token operator">&amp;</span> ConvertColor <span class="token keyword">import</span> styles</code></pre>
    Docs
    0
  • import styles from 'ansi-styles';
    
    styles.color.ansi(styles.rgbToAnsi(100, 200, 15)); // RGB to 16 color ansi foreground code
    styles.bgColor.ansi(styles.hexToAnsi('#C0FFEE')); // HEX to 16 color ansi foreground code
    
    styles.color.ansi256(styles.rgbToAnsi256(100, 200, 15)); // RGB to 256 color ansi foreground code
    styles.bgColor.ansi256(styles.hexToAnsi256('#C0FFEE')); // HEX to 256 color ansi foreground code
    
    styles.color.ansi16m(100, 200, 15); // RGB to 16 million color foreground code
    styles.bgColor.ansi16m(...styles.hexToRgb('#C0FFEE')); // Hex (RGB) to 16 million color foreground code
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> styles<span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token keyword">readonly</span> modifier<span class="token operator">:</span> Modifier<span class="token punctuation">;</span> <span class="token keyword">readonly</span> color<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> ForegroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> bgColor<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> BackgroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> codes<span class="token operator">:</span> ReadonlyMap<span class="token operator">&lt;</span><span class="token builtin">number</span><span class="token punctuation">,</span> <span class="token builtin">number</span><span class="token operator">></span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token operator">&amp;</span> ForegroundColor <span class="token operator">&amp;</span> BackgroundColor <span class="token operator">&amp;</span> Modifier <span class="token operator">&amp;</span> ConvertColor <span class="token keyword">import</span> styles</code></pre>
    Docs
    0
  • import styles from 'ansi-styles';
    
    styles.color.ansi(styles.rgbToAnsi(100, 200, 15)); // RGB to 16 color ansi foreground code
    styles.bgColor.ansi(styles.hexToAnsi('#C0FFEE')); // HEX to 16 color ansi foreground code
    
    styles.color.ansi256(styles.rgbToAnsi256(100, 200, 15)); // RGB to 256 color ansi foreground code
    styles.bgColor.ansi256(styles.hexToAnsi256('#C0FFEE')); // HEX to 256 color ansi foreground code
    
    styles.color.ansi16m(100, 200, 15); // RGB to 16 million color foreground code
    styles.bgColor.ansi16m(...styles.hexToRgb('#C0FFEE')); // Hex (RGB) to 16 million color foreground code
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> styles<span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token keyword">readonly</span> modifier<span class="token operator">:</span> Modifier<span class="token punctuation">;</span> <span class="token keyword">readonly</span> color<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> ForegroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> bgColor<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> BackgroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> codes<span class="token operator">:</span> ReadonlyMap<span class="token operator">&lt;</span><span class="token builtin">number</span><span class="token punctuation">,</span> <span class="token builtin">number</span><span class="token operator">></span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token operator">&amp;</span> ForegroundColor <span class="token operator">&amp;</span> BackgroundColor <span class="token operator">&amp;</span> Modifier <span class="token operator">&amp;</span> ConvertColor <span class="token keyword">import</span> styles</code></pre>
    Docs
    0
  • import styles from 'ansi-styles';
    
    styles.color.ansi(styles.rgbToAnsi(100, 200, 15)); // RGB to 16 color ansi foreground code
    styles.bgColor.ansi(styles.hexToAnsi('#C0FFEE')); // HEX to 16 color ansi foreground code
    
    styles.color.ansi256(styles.rgbToAnsi256(100, 200, 15)); // RGB to 256 color ansi foreground code
    styles.bgColor.ansi256(styles.hexToAnsi256('#C0FFEE')); // HEX to 256 color ansi foreground code
    
    styles.color.ansi16m(100, 200, 15); // RGB to 16 million color foreground code
    styles.bgColor.ansi16m(...styles.hexToRgb('#C0FFEE')); // Hex (RGB) to 16 million color foreground code
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> styles<span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token keyword">readonly</span> modifier<span class="token operator">:</span> Modifier<span class="token punctuation">;</span> <span class="token keyword">readonly</span> color<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> ForegroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> bgColor<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> BackgroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> codes<span class="token operator">:</span> ReadonlyMap<span class="token operator">&lt;</span><span class="token builtin">number</span><span class="token punctuation">,</span> <span class="token builtin">number</span><span class="token operator">></span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token operator">&amp;</span> ForegroundColor <span class="token operator">&amp;</span> BackgroundColor <span class="token operator">&amp;</span> Modifier <span class="token operator">&amp;</span> ConvertColor <span class="token keyword">import</span> styles</code></pre>
    Docs
    0
  • import styles from 'ansi-styles';
    
    console.log(`${styles.green.open}Hello world!${styles.green.close}`);
    
    
    // Color conversion between 256/truecolor
    // NOTE: When converting from truecolor to 256 colors, the original color
    //       may be degraded to fit the new color palette. This means terminals
    //       that do not support 16 million colors will best-match the
    //       original color.
    console.log(`${styles.color.ansi(styles.rgbToAnsi(199, 20, 250))}Hello World${styles.color.close}`)
    console.log(`${styles.color.ansi256(styles.rgbToAnsi256(199, 20, 250))}Hello World${styles.color.close}`)
    console.log(`${styles.color.ansi16m(...styles.hexToRgb('#abcdef'))}Hello World${styles.color.close}`)
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> styles<span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token keyword">readonly</span> modifier<span class="token operator">:</span> Modifier<span class="token punctuation">;</span> <span class="token keyword">readonly</span> color<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> ForegroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> bgColor<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> BackgroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> codes<span class="token operator">:</span> ReadonlyMap<span class="token operator">&lt;</span><span class="token builtin">number</span><span class="token punctuation">,</span> <span class="token builtin">number</span><span class="token operator">></span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token operator">&amp;</span> ForegroundColor <span class="token operator">&amp;</span> BackgroundColor <span class="token operator">&amp;</span> Modifier <span class="token operator">&amp;</span> ConvertColor <span class="token keyword">import</span> styles</code></pre>
    Docs
    0
  • import styles from 'ansi-styles';
    
    styles.color.ansi(styles.rgbToAnsi(100, 200, 15)); // RGB to 16 color ansi foreground code
    styles.bgColor.ansi(styles.hexToAnsi('#C0FFEE')); // HEX to 16 color ansi foreground code
    
    styles.color.ansi256(styles.rgbToAnsi256(100, 200, 15)); // RGB to 256 color ansi foreground code
    styles.bgColor.ansi256(styles.hexToAnsi256('#C0FFEE')); // HEX to 256 color ansi foreground code
    
    styles.color.ansi16m(100, 200, 15); // RGB to 16 million color foreground code
    styles.bgColor.ansi16m(...styles.hexToRgb('#C0FFEE')); // Hex (RGB) to 16 million color foreground code
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> styles<span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token keyword">readonly</span> modifier<span class="token operator">:</span> Modifier<span class="token punctuation">;</span> <span class="token keyword">readonly</span> color<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> ForegroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> bgColor<span class="token operator">:</span> ColorBase <span class="token operator">&amp;</span> BackgroundColor<span class="token punctuation">;</span> <span class="token keyword">readonly</span> codes<span class="token operator">:</span> ReadonlyMap<span class="token operator">&lt;</span><span class="token builtin">number</span><span class="token punctuation">,</span> <span class="token builtin">number</span><span class="token operator">></span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token operator">&amp;</span> ForegroundColor <span class="token operator">&amp;</span> BackgroundColor <span class="token operator">&amp;</span> Modifier <span class="token operator">&amp;</span> ConvertColor <span class="token keyword">import</span> styles</code></pre>
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples