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 {GoogleAuth} = require('google-auth-library');
    
    /**
    * Instead of specifying the type of client you'd like to use (JWT, OAuth2, etc)
    * this library will automatically choose the right client based on the environment.
    */
    async function main() {
      const auth = new GoogleAuth({
        scopes: 'https://www.googleapis.com/auth/cloud-platform'
      });
      const client = await auth.getClient();
      const projectId = await auth.getProjectId();
      const url = `https://dns.googleapis.com/dns/v1/projects/${projectId}`;
      const res = await client.request({ url });
      console.log(res.data);
    }
    
    main().catch(console.error);
    <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">class</span> <span class="token class-name">GoogleAuth</span> <span class="token keyword">import</span> GoogleAuth</code></pre>
    Docs
    0
  • async function main() {
      const auth = new GoogleAuth({
        scopes: 'https://www.googleapis.com/auth/cloud-platform'
      });
      const client = await auth.getClient();
      const projectId = await auth.getProjectId();
      // List all buckets in a project.
      const url = `https://storage.googleapis.com/storage/v1/b?project=${projectId}`;
      const res = await client.request({ url });
      console.log(res.data);
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token function">main</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></code></pre>
    Docs
    0
  • const {auth, Compute} = require('google-auth-library');
    
    async function main() {
      const client = new Compute({
        // Specifying the service account email is optional.
        serviceAccountEmail: 'my-service-account@example.com'
      });
      const projectId = await auth.getProjectId();
      const url = `https://dns.googleapis.com/dns/v1/projects/${projectId}`;
      const res = await client.request({url});
      console.log(res.data);
    }
    
    main().catch(console.error);
    <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> auth<span class="token operator">:</span> GoogleAuth <span class="token keyword">import</span> auth</code></pre>
    Docs
    0
  • const {auth, Compute} = require('google-auth-library');
    
    async function main() {
      const client = new Compute({
        // Specifying the service account email is optional.
        serviceAccountEmail: 'my-service-account@example.com'
      });
      const projectId = await auth.getProjectId();
      const url = `https://dns.googleapis.com/dns/v1/projects/${projectId}`;
      const res = await client.request({url});
      console.log(res.data);
    }
    
    main().catch(console.error);
    <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> auth<span class="token operator">:</span> GoogleAuth <span class="token keyword">import</span> auth</code></pre>
    Docs
    0
  • t.test('generate args from options', async t => {
      t.matchSnapshot(await tag('1.2.3', {
        message: 'v%s'
      }), 'default options')
      t.matchSnapshot(await tag('1.2.3', {
        signGitTag: true,
        allowSameVersion: true,
        message: 'hello, %s, this is a message for you about %s.'
      }), 'non-default options')
    })
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> t</code></pre>
    /npm/libnpmversion isc
    0
  • const runTest = tree => t => {
      
      //...
    {
        const acc = []
        const visit = accum(acc)
        breadth({ ...opt, visit })
        t.matchSnapshot(acc, 'fully sync')
      }
    
      
    
      //...
    }
    
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> <span class="token function-variable function">runTest</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token parameter">tree<span class="token operator">:</span> any</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span><span class="token parameter">t<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>
    /npm/treeverse isc
    0
  • t.test('generate args from options', async t => {
      t.matchSnapshot(await commit('1.2.3', {
        message: 'v%s'
      }), 'default options')
      t.matchSnapshot(await commit('1.2.3', {
        commitHooks: false,
        allowSameVersion: true,
        signGitCommit: true,
        message: 'hello, %s, this is a message for you about %s.'
      }), 'non-default options')
    })
    
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> t</code></pre>
    /npm/libnpmversion isc
    0
  • const {auth, Compute} = require('google-auth-library');
    
    async function main() {
      const client = new Compute({
        // Specifying the service account email is optional.
        serviceAccountEmail: 'my-service-account@example.com'
      });
      const projectId = await auth.getProjectId();
      const url = `https://dns.googleapis.com/dns/v1/projects/${projectId}`;
      const res = await client.request({url});
      console.log(res.data);
    }
    
    main().catch(console.error);
    <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> auth<span class="token operator">:</span> GoogleAuth <span class="token keyword">import</span> auth</code></pre>
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples