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

  • 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
  • //...
    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
  • 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
  • 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
  • figlet('OpenAPI Dev Tool', async (err, data) => {
      if (err) {
        console.log('Something went wrong...');
        console.dir(err);
        return -1;
      }
    
      console.log(colors.cyan(data));
      console.log(`v${app.version}`);
      console.log('\nExecuting ' + colors.cyan(config.command) + ' command...\n');
      
      //...
    })
    <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 function">figlet</span><span class="token punctuation">(</span>txt<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">,</span> options<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">,</span> next<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 keyword">import</span> figlet</code></pre>
    /lyra/openapi-dev-tool Apache-2.0
    0
  • module.exports = {
        createProxy({
            port = config.defaultPort,
            caCertPath,
            caKeyPath,
            sslConnectInterceptor,
            requestInterceptor,
            responseInterceptor,
            getCertSocketTimeout = 1 * 1000,
            middlewares = [],
            externalProxy
        }) {
    
            
    
            //...
    if (!caCertPath && !caKeyPath) {
                
                //...
    if (rs.create) {
                    console.log(colors.cyan(`CA Cert saved in: ${caCertPath}`));
                    
                    //...
    }
            }
    
            
    
            //...
    },
        
        //...
    }
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">module</span> <span class="token keyword">export</span><span class="token operator">=</span> <span class="token punctuation">(</span>property<span class="token punctuation">)</span> <span class="token keyword">export</span><span class="token operator">=</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token function">createProxy</span><span class="token punctuation">(</span><span class="token punctuation">{</span> port<span class="token punctuation">,</span> caCertPath<span class="token punctuation">,</span> caKeyPath<span class="token punctuation">,</span> sslConnectInterceptor<span class="token punctuation">,</span> requestInterceptor<span class="token punctuation">,</span> responseInterceptor<span class="token punctuation">,</span> getCertSocketTimeout<span class="token punctuation">,</span> middlewares<span class="token punctuation">,</span> externalProxy <span class="token punctuation">}</span><span class="token operator">:</span> <span class="token punctuation">{</span> port<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">;</span> caCertPath<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">;</span> caKeyPath<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">;</span> sslConnectInterceptor<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">;</span> requestInterceptor<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">;</span> responseInterceptor<span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">;</span> getCertSocketTimeout<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">;</span> middlewares<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">any</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span> externalProxy<span class="token operator">:</span> <span class="token builtin">any</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">createCA</span><span class="token punctuation">(</span>caBasePath<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">)</span><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></code></pre>
    /wuchangming/node-mitmproxy mit
    0
  • const indexProducts = async (app) => {
        
        //...
    app.productsIndex = productsIndex;
        if(process.env.NODE_ENV !== 'test'){
            console.log(colors.cyan('- Product indexing complete'));
        }
    };
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> <span class="token function-variable function">indexProducts</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token parameter">app<span class="token operator">:</span> 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>
    /mrvautin/expressCart 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
  • 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
  • const retryStr = `${colors.yellow(this.warn)} ${
        this.warn === 1 ? "retry" : "retries"
      }`;
    
      
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> retryStr<span class="token operator">:</span> <span class="token builtin">string</span></code></pre>
    /Kumar-Saksham/CSMM-CLI MIT
    0
  • module.exports.printItem = (item, id, indent) => {
      
      //...
    if (item.status === 'completed') {
        
        //...
    } else if (item.status === 'in_progress') {
        draft(indent,
          colors.yellow(`${figures.play} ${item.name}`),
          colors.grey(`${moment().diff(moment(item.started_at), 'seconds')}s`)
        )
      } else if (item.status === 'queued') {
        
        //...
    } else {
        if (item) draft(indent, item)
        else draft(indent, ' ')
      }
    }
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">var</span> module<span class="token operator">:</span> <span class="token punctuation">{</span> exports<span class="token operator">:</span> <span class="token keyword">typeof</span> module<span class="token punctuation">.</span>exports<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre>
    /abskmj/hukum MIT
    0
  • function getMessage(msg) {
      return colors.yellow(msg);
    }
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token function">getMessage</span><span class="token punctuation">(</span><span class="token parameter">msg<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>
    /balmjs/balm mit
    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
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples