How to use the flash-store function in flash-store

To help you get started, we’ve selected a few flash-store 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 huan / node-facenet / src / cache / face-cache.ts View on Github external
public init(): void {
    log.verbose('FaceCache', 'init()')

    if (!fs.existsSync(this.workdir)) {
      throw new Error(`directory not exist: ${this.workdir}`)
    }

    if (!this.store) {
      const storeName   = 'face-cache.store'
      this.store = new FlashStore(
        path.join(this.workdir, storeName),
      )
    }
    if (!this.embeddingStore) {
      const storeName   = 'face-cache-embedding.store'
      this.embeddingStore = new FlashStore(
        path.join(this.workdir, storeName),
      )
    }

    if (!this.imagedir) {
      const dirName = 'imagedir'
      this.imagedir = path.join(this.workdir, dirName)
      if (!fs.existsSync(this.imagedir)) {
        fs.mkdirSync(this.imagedir)
      }
    }
  }
github huan / node-facenet / src / cache / face-cache.ts View on Github external
public init(): void {
    log.verbose('FaceCache', 'init()')

    if (!fs.existsSync(this.workdir)) {
      throw new Error(`directory not exist: ${this.workdir}`)
    }

    if (!this.store) {
      const storeName   = 'face-cache.store'
      this.store = new FlashStore(
        path.join(this.workdir, storeName),
      )
    }
    if (!this.embeddingStore) {
      const storeName   = 'face-cache-embedding.store'
      this.embeddingStore = new FlashStore(
        path.join(this.workdir, storeName),
      )
    }

    if (!this.imagedir) {
      const dirName = 'imagedir'
      this.imagedir = path.join(this.workdir, dirName)
      if (!fs.existsSync(this.imagedir)) {
        fs.mkdirSync(this.imagedir)
      }

flash-store

FlashStore is a Key-Value persistent storage with easy to use ES6 Map-like API(both Async and Sync support), powered by LevelDB and TypeScript.

Apache-2.0
Latest version published 3 years ago

Package Health Score

36 / 100
Full package analysis