How to use the @mapeo/core.errors function in @mapeo/core

To help you get started, we’ve selected a few @mapeo/core 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 digidem / mapeo-desktop / src / mapeo-worker.js View on Github external
const fs = require('fs')
const path = require('path')
const throttle = require('lodash/throttle')
const logger = require('electron-timber')
const randombytes = require('randombytes')
const os = require('os')
const MapeoCore = require('@mapeo/core')
const sublevel = require('subleveldown')

const createMapeoServer = require('./main/server')
const installStatsIndex = require('./main/osm-stats')
const userConfig = require('./main/user-config')

const errors = MapeoCore.errors

const expectedMediaFormats = ['original', 'preview', 'thumbnail']

class MapeoRPC {
  constructor (datadir, ipcSend) {
    // TODO: bind all the things since they're being passed
    // around a lot to various event listeners...
    this.mapeo = createMapeo(datadir)
    this.ipcSend = ipcSend
    this.ipcSend('indexes-loading')
    this.mapeo.osm.ready(() => {
      logger.log('indexes READY')
      this.ipcSend('indexes-ready')
    })

    // Sending data over IPC is costly, and progress events fire frequently, so we

@mapeo/core

Offline p2p mapping library

MIT
Latest version published 2 months ago

Package Health Score

57 / 100
Full package analysis

Popular @mapeo/core functions