How to use the datastore-core.ShardingDatastore function in datastore-core

To help you get started, we’ve selected a few datastore-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 ipfs / js-datastore-fs / test / index.spec.js View on Github external
/* eslint-env mocha */
'use strict'

const chai = require('chai')
chai.use(require('dirty-chai'))
const expect = chai.expect
const path = require('path')
const promisify = require('util').promisify
const noop = () => {}
const mkdirp = require('mkdirp')
const rimraf = promisify(require('rimraf'))
const fs = require('fs')
const fsReadFile = promisify(require('fs').readFile || noop)
const Key = require('interface-datastore').Key
const utils = require('interface-datastore').utils
const ShardingStore = require('datastore-core').ShardingDatastore
const sh = require('datastore-core').shard
const isNode = require('detect-node')

const FsStore = require('../src')

describe('FsDatastore', () => {
  if (!isNode) {
    it('only supports node.js', () => {

    })

    return
  }

  describe('construction', () => {
    it('defaults - folder missing', () => {