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

  • 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
  • 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
  • async update(name, content) {
        const fileName = this.getFileName(name);
        try {
          const result = await this.client.put(fileName, content);
          if (+result.res.statusCode === 200) {
            log(colors.green(`${fileName}上传成功!`));
          } else {
            log(colors.red(`${fileName}上传失败!`));
          }
        } catch (error) {
          log(colors.red(`${fileName}上传失败!`));
        }
      }
    
      
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>method<span class="token punctuation">)</span> AliOSS<span class="token punctuation">.</span><span class="token function">update</span><span class="token punctuation">(</span>name<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">,</span> content<span class="token operator">:</span> <span class="token builtin">any</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></code></pre>
    /vbigbang/webpack-oss MIT
    0
  • function initTask() {
      
      //...
    log(colors.green("Generating default Nucleum project files"));
      log(
        colors.yellow(`
        To start the dev server run:
      `),
        colors.magenta(`
        yarn dev
      `)
      );
    
      
    
      //...
    }
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token function">initTask</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> internal<span class="token punctuation">.</span>PassThrough <span class="token keyword">module</span> initTask</code></pre>
    /CosAnca/nucleum MIT
    0
  • function appAndPluginWatch(done) {
    
      log(colors.green('Watching source files...'));
    
      // Licenses
      gulp.watch(paths.license_md, () => appLicense());
    
      // App
      gulp.watch(paths.sass, () => appSass());
      gulp.watch(paths.templatecache, () => appNgTemplate());
      gulp.watch(paths.ng_annotate, (event) => appNgAnnotate(event));
      gulp.watch(paths.ng_translate, () => appNgTranslate());
      
      //...
    }
    
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token function">appAndPluginWatch</span><span class="token punctuation">(</span><span class="token parameter">done<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>
    /duniter/cesium agpl-3.0
    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
  • const cli = meow(
      `
      Usage
        left-phalange <file>
        lp <file>
    
      Options
        -i, --input           ${colors.cyan('Input Data type')}
        -o, --output          ${colors.cyan('Output Data type')}
        -p, --pretty          ${colors.cyan('Pretty output')}
        -C, --copy            ${colors.cyan('Copy output to clipboard')}
        -h, --help            ${colors.cyan('Show this help info')}
        -v, --version         ${colors.cyan('Show version')}
    
      Examples
        lp data.toml > data.json
        cat data.yaml | lp -p
      `,
      {
        
        //...
    ,
      },
    )
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> cli<span class="token operator">:</span> Result<span class="token operator">&lt;</span><span class="token punctuation">{</span> pretty<span class="token operator">:</span> <span class="token punctuation">{</span> type<span class="token operator">:</span> <span class="token string">"boolean"</span><span class="token punctuation">;</span> <span class="token keyword">default</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">;</span> alias<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">;</span> input<span class="token operator">:</span> <span class="token punctuation">{</span> alias<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">;</span> output<span class="token operator">:</span> <span class="token punctuation">{</span> alias<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">;</span> copy<span class="token operator">:</span> <span class="token punctuation">{</span> type<span class="token operator">:</span> <span class="token string">"boolean"</span><span class="token punctuation">;</span> <span class="token keyword">default</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">;</span> alias<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">;</span> help<span class="token operator">:</span> <span class="token punctuation">{</span> alias<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">;</span> version<span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token operator">...</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token operator">></span></code></pre>
    /fisker/left-phalange mit
    0
  • //...
    const skip = () => {};
    skip.add = () => skip;
    skip.run = () => skip;
    bench.skip = name => {
      console.log(colors.cyan('● ' + colors.unstyle(name) + ' (skipped)'));
      return skip;
    };
    
    bench('alpha')
      .add('fill 6.0', () => fill60('a', 'z'))
      .add('fill 7.0', () => fill70('a', 'z'))
      .run();
    
    
    
    //...
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">module</span> skip <span class="token keyword">const</span> skip<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 keyword">void</span><span class="token punctuation">;</span> <span class="token function">add</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token operator">...</span><span class="token punctuation">;</span> <span class="token function">run</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token operator">...</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre>
    /jonschlinkert/fill-range MIT
    0
  • FileStore.prototype.syncFolder = function (sFolder, sModif, fnCallback) {
        
        //...
    me._sendRequest(oRequest, function (oResponse) {
            if (oResponse.error) {
                log(colors.red('[FAILED]'), 'Folder', colors.cyan(sFolder), sModif + 'd.');
                fnCallback(util.createResponseError(oRequest, oResponse), oResponse);
            } else {
                log(colors.green('[OK]'), 'Folder', colors.cyan(sFolder), sModif + 'd.');
                fnCallback(null, oResponse);
            }
        });
    
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">class</span> <span class="token class-name">FileStore</span> <span class="token keyword">var</span> FileStore<span class="token operator">:</span> <span class="token keyword">typeof</span> FileStore</code><div class="typing-tooltip-markup">FileStore constructor<br><br><em>@public</em><br><br><em>@param</em> <code>oOptions</code> — Options for FileStore<br><br><em>@returns</em></div></pre>
    /nrdev88/nwabap-ui5uploader Apache-2.0
    0
  • console.log(c.yellow(`foo ${c.red.bold('red')} bar ${c.cyan('cyan')} baz`));
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">var</span> <span class="token builtin">console</span><span class="token operator">:</span> Console</code></pre>
    Docs
    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
  • 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 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 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 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 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