rxdb
v15.36.1 db database offline-first local-first local first nosql no-sql jsonschema schema and 60 more...
postinstall
node scripts/postinstall.js || echo "ignore"
test
npm run test:node && npm run test:browser
// test:fast
run tests in the fast-mode. Most of them will run in parrallel, skips tests that are known slow
test:fast
npm run test:fast:memory && npm run test:fast:lokijs && npm run test:fast:dexie
test:fast:memory
npm run transpile && cross-env DEFAULT_STORAGE=memory NODE_ENV=fast mocha --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:fast:memory-validation
npm run transpile && cross-env DEFAULT_STORAGE=memory-validation NODE_ENV=fast mocha --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:fast:memory-random-delay
npm run transpile && cross-env DEFAULT_STORAGE=memory-random-delay NODE_ENV=fast mocha --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:fast:lokijs
npm run transpile && cross-env DEFAULT_STORAGE=lokijs NODE_ENV=fast mocha --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:fast:dexie
npm run transpile && cross-env DEFAULT_STORAGE=dexie NODE_ENV=fast mocha --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:fast:foundationdb
npm run transpile && cross-env DEFAULT_STORAGE=foundationdb NODE_ENV=fast mocha --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:fast:mongodb
npm run transpile && cross-env DEFAULT_STORAGE=mongodb NODE_ENV=fast mocha --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
// test:fast:loop
runs tests in the fast-mode in a loop. Use this to debug tests that only fail sometimes
test:fast:loop
npm run test:fast && npm run test:fast:loop
test:fast:loop:lokijs
npm run test:fast:lokijs && npm run test:fast:loop:lokijs
test:fast:loop:memory
npm run test:fast:memory && npm run test:fast:loop:memory
test:fast:loop:dexie
npm run test:fast:dexie && npm run test:fast:loop:dexie
test:fast:loop:mongodb
npm run test:fast:mongodb && npm run test:fast:loop:mongodb
test:fast:loop:memory-random-delay
npm run test:fast:memory-random-delay && npm run test:fast:loop:memory-random-delay
test:node
npm run test:node:lokijs && npm run test:node:dexie
test:node:memory
npm run transpile && cross-env DEFAULT_STORAGE=memory mocha --expose-gc --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:node:memory-validation
npm run transpile && cross-env DEFAULT_STORAGE=memory-validation mocha --expose-gc --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:node:memory-random-delay
npm run transpile && cross-env DEFAULT_STORAGE=memory-random-delay mocha --expose-gc --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:node:lokijs
npm run transpile && cross-env DEFAULT_STORAGE=lokijs mocha --expose-gc --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:node:dexie
npm run transpile && cross-env DEFAULT_STORAGE=dexie mocha --expose-gc --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:bun:dexie
npm run transpile && cross-env DEFAULT_STORAGE=dexie NODE_ENV=fast bun run ./node_modules/mocha/bin/mocha test_tmp/unit.test.js --bail
test:deno:dexie
npm run transpile && cross-env DEFAULT_STORAGE=dexie deno run --unstable --allow-env --unstable-byonm --allow-read -A npm:mocha ./test/unit.test.ts --bail
test:deno:denokv
npm run transpile && cross-env DEFAULT_STORAGE=denokv deno run --unstable --allow-env --unstable-byonm --allow-read -A npm:mocha ./test/unit.test.ts --bail
test:deno:denokv:loop
npm run test:deno:denokv && npm run test:deno:denokv:loop
test:deno:memory
npm run transpile && cross-env DEFAULT_STORAGE=memory deno run --unstable --allow-env --unstable-byonm --allow-read -A npm:mocha ./test/unit.test.ts --bail
test:node:foundationdb
npm run transpile && cross-env DEFAULT_STORAGE=foundationdb mocha --expose-gc --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:node:mongodb
npm run transpile && cross-env DEFAULT_STORAGE=mongodb mocha --expose-gc --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:node:mongodb:loop
npm run test:node:mongodb && npm run test:node:mongodb:loop
test:node:remote
npm run transpile && cross-env DEFAULT_STORAGE=remote mocha --expose-gc --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
test:node:remote:loop
npm run test:node:remote && npm run test:node:remote:loop
test:node:lokijs:loop
npm run test:node:lokijs && npm run test:node:lokijs:loop
test:node:memory:loop
npm run test:node:memory && npm run test:node:memory:loop
test:node:dexie:loop
npm run test:node:dexie && npm run test:node:dexie:loop
test:node:foundationdb:loop
npm run test:node:foundationdb && npm run test:node:foundationdb:loop
test:node:custom
npm run transpile && cross-env DEFAULT_STORAGE=custom mocha --expose-gc --config ./config/.mocharc.cjs ./test_tmp/unit.test.js
// test:node:loop
runs tests in node in a loop. Use this to debug tests that only fail sometimes
test:node:loop
npm run test:node && npm run test:node:loop
test:node:loop:memory-random-delay
npm run test:node:memory-random-delay && npm run test:node:loop:memory-random-delay
test:browser:loop
npm run test:browser && npm run test:browser:loop
test:browser:lokijs
npm run transpile && cross-env CI=true DEFAULT_STORAGE=lokijs karma start ./config/karma.conf.cjs --single-run
test:browser:memory
npm run transpile && cross-env CI=true DEFAULT_STORAGE=memory karma start ./config/karma.conf.cjs --single-run
test:browser:memory:loop
npm run test:browser:memory && npm run test:browser:memory:loop
test:browser:dexie
npm run transpile && cross-env CI=true DEFAULT_STORAGE=dexie karma start ./config/karma.conf.cjs --single-run
test:browser:remote
npm run transpile && cross-env CI=true DEFAULT_STORAGE=remote karma start ./config/karma.conf.cjs --single-run
test:browser:remote:loop
npm run test:browser:remote && npm run test:browser:remote:loop
test:browser:custom
npm run transpile && cross-env CI=true DEFAULT_STORAGE=custom karma start ./config/karma.conf.cjs --single-run
test:replication-firestore
npm run transpile && firebase emulators:exec "cross-env DEFAULT_STORAGE=dexie mocha --expose-gc --config ./config/.mocharc.cjs ./test_tmp/replication-firestore.test.js" --only firestore --project 'rxdb-test'
test:replication-couchdb
npm run transpile && concurrently "npm run couch:start" "cross-env NATIVE_COUCHDB=5984 DEFAULT_STORAGE=dexie mocha --config ./config/.mocharc.cjs ./test_tmp/replication-couchdb.test.js" --success first --kill-others
test:replication-nats
npm run transpile && concurrently "npm run nats:start" "cross-env DEFAULT_STORAGE=dexie mocha --config ./config/.mocharc.cjs ./test_tmp/replication-nats.test.js" --success first --kill-others
test:core
npm run transpile && mocha ./test_tmp/unit/core.node.js
test:full
npm run transpile && mocha ./test_tmp/unit/full.node.js
test:typings
npm run build:plugins && tsc --allowImportingTsExtensions --noEmit --skipLibCheck --lib "ES2022,DOM" ./test/typings.test.ts
test:deps
npm run build && dependency-check ./package.json ./dist/cjs/index.js ./dist/cjs/plugins/validate-is-my-json-valid/index.js ./dist/cjs/plugins/attachments-compression/index.js ./dist/cjs/plugins/validate-ajv/index.js ./dist/cjs/plugins/update/index.js ./dist/cjs/plugins/key-compression/index.js ./dist/cjs/plugins/dev-mode/index.js ./dist/cjs/plugins/encryption-crypto-js/index.js ./dist/cjs/plugins/replication-graphql/index.js ./dist/cjs/plugins/replication-webrtc/index.js ./dist/cjs/plugins/replication-websocket/index.js ./dist/cjs/plugins/replication-firestore/index.js ./dist/cjs/plugins/replication-nats/index.js ./dist/cjs/plugins/validate-z-schema/index.js ./dist/cjs/plugins/storage-lokijs/index.js ./dist/cjs/plugins/storage-dexie/index.js ./dist/cjs/plugins/storage-memory/index.js ./dist/cjs/plugins/storage-mongodb/index.js --no-dev --ignore-module util --ignore-module url --ignore-module ws --ignore-module graphql --ignore-module as-typed --ignore-module "@types/*"
test:circular
npm run build && madge --circular ./dist/esm/index.js && madge --circular ./dist/esm/plugins/storage-dexie/index.js
test:performance:lokijs:browser
npm run transpile && cross-env DEFAULT_STORAGE=lokijs CI=true karma start ./config/karma.performance.conf.cjs --single-run
test:performance:lokijs:node
npm run transpile && cross-env DEFAULT_STORAGE=lokijs mocha --config ./config/.mocharc.cjs ./test_tmp/performance.test.js --unhandled-rejections=strict --expose-gc
test:performance:dexie
npm run transpile && cross-env DEFAULT_STORAGE=dexie CI=true karma start ./config/karma.performance.conf.cjs --single-run
test:performance:memory:browser
npm run transpile && cross-env DEFAULT_STORAGE=memory CI=true karma start ./config/karma.performance.conf.cjs --single-run
test:performance:memory:node
npm run transpile && cross-env DEFAULT_STORAGE=memory mocha --config ./config/.mocharc.cjs ./test_tmp/performance.test.js --unhandled-rejections=strict --expose-gc
test:performance:memory:bun
npm run transpile && cross-env DEFAULT_STORAGE=memory bun run ./node_modules/mocha/bin/mocha test_tmp/performance.test.js --bail
test:performance:memory:deno
npm run transpile && cross-env DEFAULT_STORAGE=memory deno run --unstable --allow-env --allow-read -A npm:mocha test/performance.test.ts --bail
test:performance:foundationdb
npm run transpile && cross-env DEFAULT_STORAGE=foundationdb mocha --config ./config/.mocharc.cjs ./test_tmp/performance.test.js --unhandled-rejections=strict --expose-gc
test:performance:mongodb
npm run transpile && cross-env DEFAULT_STORAGE=mongodb mocha --config ./config/.mocharc.cjs ./test_tmp/performance.test.js --unhandled-rejections=strict --expose-gc
test:performance:custom:browser
npm run transpile && cross-env DEFAULT_STORAGE=custom CI=true karma start ./config/karma.performance.conf.cjs --single-run
test:performance:custom:node
npm run transpile && cross-env DEFAULT_STORAGE=custom mocha --config ./config/.mocharc.cjs ./test_tmp/performance.test.js --unhandled-rejections=strict --expose-gc
test:performance
npm run build && npm run test:performance:lokijs:browser && npm run test:performance:lokijs:node && npm run test:performance:dexie && npm run test:performance:memory:browser && npm run test:performance:memory:node
test:query-correctness-fuzzing:memory:node
npm run transpile && cross-env DEFAULT_STORAGE=memory mocha --config ./config/.mocharc.cjs ./test_tmp/query-correctness-fuzzing.test.js --unhandled-rejections=strict --expose-gc
test:query-correctness-fuzzing:custom:node
npm run transpile && cross-env DEFAULT_STORAGE=custom mocha --config ./config/.mocharc.cjs ./test_tmp/query-correctness-fuzzing.test.js --unhandled-rejections=strict --expose-gc
test:query-correctness-fuzzing:lokijs:node
npm run transpile && cross-env DEFAULT_STORAGE=lokijs mocha --config ./config/.mocharc.cjs ./test_tmp/query-correctness-fuzzing.test.js --unhandled-rejections=strict --expose-gc
couch:start
docker run -p 5984:5984 -e COUCHDB_USER=root -e COUCHDB_PASSWORD=root --rm --name rxdb-couchdb couchdb:3.3.3
couch:stop
docker rm -f rxdb-couchdb
mongodb:start
docker run -p 27017:27017 -p 27018:27018 -p 27019:27019 --rm --name rxdb-mongodb mongo:7.0.1
mongodb:stop
docker rm -f rxdb-mongodb
nats:start
docker run --rm --name rxdb-nats -p 4222:4222 nats:2.9.17 -js
nats:stop
docker rm -f rxdb-nats
dockertest
docker run -it -v $(pwd):/usr/src/app markadams/chromium-xvfb-js:latest-onbuild
profile
npm run transpile && rm -f isolate-* && cross-env DEFAULT_STORAGE=memory NODE_PROF=true mocha --config ./config/.mocharc.cjs ./test_tmp/performance.test.js --v8-prof --expose-gc && node scripts/profile.mjs
clear
rimraf -rf test_tmp/ && rimraf -rf dist/ && rimraf .transpile_state.json
lint
eslint .
lint:fix
eslint . --fix
lint:debug:files
DEBUG=eslint:cli-engine eslint .
lint:debug:time
TIMING=1 eslint .
check-types
tsc
transpile
npm run build:version && node scripts/transpile.mjs && cp ./scripts/module_package.json test_tmp/package.json
build:version
node ./scripts/update-version-variable.mjs
build:esm
npm run build:version && rimraf -rf --max-retries=3 dist/esm && cross-env NODE_ENV=es6 babel src --out-dir dist/esm --source-maps --extensions ".ts,.js" && cp ./scripts/module_package_no_side.json dist/esm/package.json
build:types
npm run build:version && rimraf -rf --max-retries=3 ./dist/types && tsc --project ./config/tsconfig.types.json && cp -r ./src/types ./dist/types/types && node ./scripts/fix-types.mjs
build
npm run clear && npm run build:version && concurrently "npm run transpile" "npm run build:esm" "npm run build:types" "npm run build:plugins"
build:plugins
node ./scripts/generate-plugins-package-json.mjs
build:webpack
npm run build && cross-env NODE_ENV=build webpack --config ./config/webpack.config.js
build:rollup
npm run build && rollup --config ./config/rollup.config.mjs
build:size
npm run build:webpack && echo "Build-Size (minified+gzip):" && gzip-size --raw ./test_tmp/webpack.bundle.js
docs:install
(cd docs-src/ && npm install)
// docs:serve
start a local server to watch the docs. Served at http://localhost:4000/
docs:serve
(cd docs-src/ && npm start)
docs:build
rimraf -rf ./docs && mkdir ./docs && (cd docs-src/ && npm run build) && cp -r ./docs-src/build/* ./docs && cp ./docs-src/CNAME ./docs/CNAME
docs:remove:time
node ./scripts/docs-remove-time.mjs
disc
npm run transpile && npm run build:esm && cross-env NODE_ENV=disc webpack --config ./config/webpack.config.js
preversion
npm run lint && npm run test
dev
watch 'npm run test:node:memory' src/ test/
dev:example
watch 'npm run transpile:src && echo "done"' src/ test/
cloud-signaling-server
node ./scripts/start-cloud-signaling-server.mjs --max-old-space-size=2048