How to use calibre - 8 common examples

To help you get started, we’ve selected a few calibre examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github calibreapp / cli / examples / nodejs / deploys / create.js View on Github external
const createDeploy = async () => {
  // Required
  const site = 'calibre'

  // Optional
  const revision = 'v100'
  const repository = 'https://github.com/calibreapp'
  const username = 'micdijkstra'
  const createdAt = '2019-04-25T04:11:00+10:00'

  // Create the deploy
  const deploy = await Deploy.create({
    site,
    revision,
    repository,
    username,
    createdAt
  })

  // Output the formatted JSON response
  console.log(JSON.stringify(deploy, null, 2))
}
github calibreapp / cli / examples / nodejs / deploys / list.js View on Github external
const listDeploys = async () => {
  // Required
  const site = 'calibre'

  // List the deploys
  const deploys = await Deploy.list({
    site
  })

  // Output the formatted JSON response
  console.log(JSON.stringify(deploys, null, 2))
}
github calibreapp / cli / examples / nodejs / integrations / list.js View on Github external
const listIntegrations = async () => {
  const site = 'calibre' // site slug
  const count = 20 // number of integrations to return, maximum 500

  // List the integrations
  const integrations = await Integration.list({
    site,
    count
  })

  // Output the formatted JSON response
  console.log(JSON.stringify(integrations, null, 2))
}
github calibreapp / cli / examples / nodejs / snapshots / create.js View on Github external
const createSnapshot = async () => {
  // Required
  const site = 'calibre'

  // Optional
  const ref = 'v100'

  // Create the snapshot
  const snapshot = await Snapshot.create({
    site,
    ref
  })

  // Output the formatted JSON response
  console.log(JSON.stringify(snapshot, null, 2))
}
github calibreapp / cli / examples / nodejs / graphql-request.js View on Github external
const site = async () => {
  const query = `
    query Site($slug: String!){
      organisation {
        site(slug: $slug) {
          name
          slug
        }
      }
    }
  `
  const slug = 'calibre'

  try {
    const result = await GraphQL.request({ query, slug })
    console.log(result)
  } catch (e) {
    console.error(e)
  }
}
github calibreapp / cli / examples / nodejs / sites / create.js View on Github external
value: 'sessionId',
          domain: 'calibreapp.com',
          path: '/',
          secure: true,
          httpOnly: true
        }
      ]
    },
    {
      name: 'iPhone 8, 3G',
      device: 'iPhone8',
      connection: 'good3G'
    }
  ]
  try {
    const site = await Site.create({ name, location, pages, testProfiles })

    console.log('Created', site)
  } catch (e) {
    console.error(e)
  }
}
github calibreapp / cli / examples / nodejs / get-all-pulse-metrics.js View on Github external
const main = async () => {
  const sites = await Site.list()

  const to = new Date()

  const from = new Date()
  from.setDate(to.getDate() - 7)

  console.log(`=== ${sites.length} sites`)

  const metrics = await Promise.all(
    sites.map(({ slug }) => {
      return TimeSeries.list({
        site: slug,
        from: from.toUTCString(),
        to: to.toUTCString(),
        measurements: ['consistently-interactive']
      })
github calibreapp / cli / examples / nodejs / get-all-pulse-metrics.js View on Github external
sites.map(({ slug }) => {
      return TimeSeries.list({
        site: slug,
        from: from.toUTCString(),
        to: to.toUTCString(),
        measurements: ['consistently-interactive']
      })
    })
  )

calibre

Calibre - Page speed performance testing with Google Lighthouse

MIT
Latest version published 3 months ago

Package Health Score

84 / 100
Full package analysis