{"_id":"scopedb","_rev":"9-0901cab34c7eb2d6a60f8d7870cffd7f","name":"scopedb","dist-tags":{"latest":"0.2.2"},"versions":{"0.0.1":{"name":"scopedb","version":"0.0.1","license":"Apache-2.0","_id":"scopedb@0.0.1","maintainers":[{"name":"tisonkun","email":"wander4096@gmail.com"}],"dist":{"shasum":"55826759a3f353904cf0b74e5a271d2a77ee87a1","tarball":"https://registry.npmjs.org/scopedb/-/scopedb-0.0.1.tgz","fileCount":35,"integrity":"sha512-+Ozl+y/WgZEo4Gc+eypyLdtUmedJOi9y5U0h2o38gV79ka/vIitqG+RRAmikWVe1YeIOJep4f+yWgyqjQvAdyg==","signatures":[{"sig":"MEUCICbTc3HU9oikbp1lONvBo40VrUKpltUVT1usBqM9/mo0AiEA6dPv3D6/xQILQIxFr5dtfD+4osUmexdRLIoPr0CFOfE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":119366},"main":"./dist/index.js","type":"module","_from":"file:scopedb-0.0.1.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"tsc -p tsconfig.test.json --noEmit && tsc -p tsconfig.test.json && node --test dist-test/tests/*.test.js","build":"tsc -p tsconfig.json","check":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"tisonkun","email":"wander4096@gmail.com"},"_resolved":"/private/var/folders/xr/p0g_fjgn72d5rqx17xjv9sv00000gn/T/f1d9e0d4ba63361adeef7e0e07b6bbd4/scopedb-0.0.1.tgz","_integrity":"sha512-+Ozl+y/WgZEo4Gc+eypyLdtUmedJOi9y5U0h2o38gV79ka/vIitqG+RRAmikWVe1YeIOJep4f+yWgyqjQvAdyg==","_npmVersion":"11.11.0","description":"A Node.js client for ScopeDB","directories":{},"_nodeVersion":"25.8.1","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.2","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/scopedb_0.0.1_1773593640879_0.6692416047647511","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"scopedb","version":"0.0.2","license":"Apache-2.0","_id":"scopedb@0.0.2","maintainers":[{"name":"tisonkun","email":"wander4096@gmail.com"},{"name":"leiysky","email":"leiysky@outlook.com"}],"dist":{"shasum":"de15c3181274b2b42dd84d3715f61e37e1fa9555","tarball":"https://registry.npmjs.org/scopedb/-/scopedb-0.0.2.tgz","fileCount":35,"integrity":"sha512-Im5BzCLNHYD+k3u1JZzNbYXd7onrM5m7/n0VPS55tpqb/aXYv2MO6K0fsyQ4H0ym0ZkAVcdOC4PjY5NgMRtIKA==","signatures":[{"sig":"MEYCIQDnCyDjjQFd84vrx9SPxjl34Fi0l9rtUk6t/KSKenZLUwIhAOapu7fWJxQitDKyjSKjgXBuGpppdToyf4/QLumxJap3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":125061},"main":"./dist/index.js","type":"module","_from":"file:scopedb-0.0.2.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"tsc -p tsconfig.test.json --noEmit && tsc -p tsconfig.test.json && node --test dist-test/tests/*.test.js","build":"tsc -p tsconfig.json","check":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"leiysky","email":"leiysky@outlook.com"},"_resolved":"/private/var/folders/06/y1z69rlx49q6j04qvm84_vhr0000gn/T/2b52432043f7d56d01fa8bd8beed573a/scopedb-0.0.2.tgz","_integrity":"sha512-Im5BzCLNHYD+k3u1JZzNbYXd7onrM5m7/n0VPS55tpqb/aXYv2MO6K0fsyQ4H0ym0ZkAVcdOC4PjY5NgMRtIKA==","_npmVersion":"11.8.0","description":"A Node.js client for ScopeDB","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.2","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/scopedb_0.0.2_1779609575079_0.74401023020646","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"scopedb","version":"0.0.3","license":"Apache-2.0","_id":"scopedb@0.0.3","maintainers":[{"name":"tisonkun","email":"wander4096@gmail.com"},{"name":"leiysky","email":"leiysky@outlook.com"}],"dist":{"shasum":"870f99fa991b92d5e9b9417f6ccacda637cbd6e2","tarball":"https://registry.npmjs.org/scopedb/-/scopedb-0.0.3.tgz","fileCount":35,"integrity":"sha512-5514a4A67vk/nwlIh/smUGJwmcFma9XA4V28BdVHX1cxZbDx4OBc4WlJ7k6J1FkCLI4TnUbYAmqzEf9ND4HtIw==","signatures":[{"sig":"MEQCIEX9bFFME8Vb/Tn+JXPNneA+BPvi0Ugm+JQQTXe20rvQAiAMSeSjaathg6I+ZiXm2hiN9bce31fx/qmtMhVzdZV7wQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":128893},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"5b9717e2012b166b0b5b612dfc370a768657928b","scripts":{"test":"tsc -p tsconfig.test.json --noEmit && tsc -p tsconfig.test.json && node --test dist-test/tests/*.test.js","build":"tsc -p tsconfig.json","check":"tsc -p tsconfig.json --noEmit","prepack":"pnpm run build"},"_npmUser":{"name":"leiysky","email":"leiysky@outlook.com"},"_npmVersion":"11.8.0","description":"A Node.js client for ScopeDB","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.32.1","devDependencies":{"typescript":"^5.8.2","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/scopedb_0.0.3_1784124284659_0.44422531192764536","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"scopedb","version":"0.1.0","license":"Apache-2.0","_id":"scopedb@0.1.0","maintainers":[{"name":"tisonkun","email":"wander4096@gmail.com"},{"name":"leiysky","email":"leiysky@outlook.com"}],"dist":{"shasum":"1fd8572a3afdeacec69ad1a1a49a10b37802a6fe","tarball":"https://registry.npmjs.org/scopedb/-/scopedb-0.1.0.tgz","fileCount":53,"integrity":"sha512-WnH19FNXUCqb6GK/c9wpSpOa4q2cg44706M8/7lvL04goXxhjpzJ1PZCiYhNw5V0QLFf0qP1bv7BrKNBlXBudQ==","signatures":[{"sig":"MEUCIHvT1Z0syfdIJcnIdMcPpv5xG631ZyUXY0WOLu+USKIDAiEAmQUiHF6j4pgJ1zcYDnwHrzj8LCZ9mILHM/F8C+oDbVU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":284095},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"9cef9c76e127aa9529b495232b1b06604fefaf03","scripts":{"test":"tsc -p tsconfig.test.json --noEmit && tsc -p tsconfig.test.json && node --test dist-test/tests/*.test.js","build":"pnpm run clean:dist && tsc -p tsconfig.json","check":"pnpm run build && pnpm run check:examples:built","example":"pnpm run build:examples && node scripts/run-example.mjs","prepack":"pnpm run check","clean:dist":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"","example:list":"node scripts/run-example.mjs --list","check:package":"node --input-type=module -e \"const sdk = await import('scopedb'); if (typeof sdk.Client !== 'function' || typeof sdk.AppendStream !== 'function' || typeof sdk.AppendRowsError !== 'function') throw new Error('public package entry is incomplete')\"","build:examples":"pnpm run build && pnpm run clean:examples && tsc -p tsconfig.examples.json","check:examples":"pnpm run build && pnpm run check:examples:built","clean:examples":"node -e \"require('node:fs').rmSync('dist-test/examples-build', { recursive: true, force: true })\"","example:append":"pnpm run example -- append","example:catalog":"pnpm run example -- catalog","example:statement":"pnpm run example -- statement","example:append-bulk":"pnpm run example -- append-bulk","check:examples:built":"tsc -p tsconfig.examples.json --noEmit && pnpm run check:package","example:append-stream":"pnpm run example -- append-stream","example:append-telemetry":"pnpm run example -- append-telemetry","example:ingest-transform":"pnpm run example -- ingest-transform"},"_npmUser":{"name":"leiysky","email":"leiysky@outlook.com"},"_npmVersion":"11.8.0","description":"A Node.js client for ScopeDB","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.32.1","devDependencies":{"typescript":"^5.8.2","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/scopedb_0.1.0_1785922382456_0.4443956703315304","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"scopedb","version":"0.1.1","license":"Apache-2.0","_id":"scopedb@0.1.1","maintainers":[{"name":"tisonkun","email":"wander4096@gmail.com"},{"name":"leiysky","email":"leiysky@outlook.com"}],"dist":{"shasum":"02513d798f69b50f0e23fd251216eb8fd62fd11d","tarball":"https://registry.npmjs.org/scopedb/-/scopedb-0.1.1.tgz","fileCount":53,"integrity":"sha512-mE8+7XNXGVErJs0dA/G0yxyNXN4UnH0qDR6qnMd5yV1QqhvNAWv9LRX6rgGzyn1dEC7UzVF+9uqCAYag8MKkRQ==","signatures":[{"sig":"MEUCIDdR2MYfMqx9ptYmGY/GKqV5ENcw0oYkA4wYVSXrYnzOAiEA5y13DjQR3idhE1I+W5Plqg+5eKlXBTt3gJpC3mWhdjA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":283669},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"79bc68b1237cf12aaf3d99d60fd5f82ac2577241","scripts":{"test":"tsc -p tsconfig.test.json --noEmit && tsc -p tsconfig.test.json && node --test dist-test/tests/*.test.js","build":"pnpm run clean:dist && tsc -p tsconfig.json","check":"pnpm run build && pnpm run check:examples:built","example":"pnpm run build:examples && node scripts/run-example.mjs","prepack":"pnpm run check","clean:dist":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"","example:list":"node scripts/run-example.mjs --list","check:package":"node --input-type=module -e \"const sdk = await import('scopedb'); if (typeof sdk.Client !== 'function' || typeof sdk.AppendStream !== 'function' || typeof sdk.AppendRowsError !== 'function') throw new Error('public package entry is incomplete')\"","build:examples":"pnpm run build && pnpm run clean:examples && tsc -p tsconfig.examples.json","check:examples":"pnpm run build && pnpm run check:examples:built","clean:examples":"node -e \"require('node:fs').rmSync('dist-test/examples-build', { recursive: true, force: true })\"","example:append":"pnpm run example -- append","example:catalog":"pnpm run example -- catalog","example:statement":"pnpm run example -- statement","example:append-bulk":"pnpm run example -- append-bulk","check:examples:built":"tsc -p tsconfig.examples.json --noEmit && pnpm run check:package","example:append-stream":"pnpm run example -- append-stream","example:append-telemetry":"pnpm run example -- append-telemetry","example:ingest-transform":"pnpm run example -- ingest-transform"},"_npmUser":{"name":"leiysky","email":"leiysky@outlook.com"},"_npmVersion":"11.8.0","description":"A Node.js client for ScopeDB","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.32.1","devDependencies":{"typescript":"^5.8.2","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/scopedb_0.1.1_1785940757995_0.10059334376781504","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"scopedb","version":"0.2.0","keywords":["scopedb","scopeql","database","analytics","observability","typescript","nextjs","bun","serverless"],"license":"Apache-2.0","_id":"scopedb@0.2.0","maintainers":[{"name":"tisonkun","email":"wander4096@gmail.com"},{"name":"leiysky","email":"leiysky@outlook.com"}],"homepage":"https://docs.scopedb.io/developer/nodejs","bugs":{"url":"https://github.com/scopedb/scopedb-js/issues"},"dist":{"shasum":"b3c4ed07ff08611ef45692c7bcb1df5567b35c11","tarball":"https://registry.npmjs.org/scopedb/-/scopedb-0.2.0.tgz","fileCount":57,"integrity":"sha512-i3k2d02/rz+KBqVwu6hFol8GyXt0UOnwByRiRCgPFEEjxjEGi0K4vCL6owcB7P08e7FiMjwKnxX3woJLFeaY5Q==","signatures":[{"sig":"MEQCIHyblh3fwV1u3YmJO1dBc3aDzByw9oyfqtJmNuNbeUXpAiAtT6rSLO4KU0oTvcg0Q32mlUQgnSo7gnW8D3b/mSfttA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":330718},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"c6b8dac262cd9fd95260f11440323eb74265599c","scripts":{"test":"tsc -p tsconfig.test.json --noEmit && tsc -p tsconfig.test.json && node --test dist-test/tests/*.test.js","build":"pnpm run clean:dist && tsc -p tsconfig.json","check":"pnpm run build && pnpm run check:examples:built","example":"pnpm run build:examples && node scripts/run-example.mjs","prepack":"pnpm run test && pnpm run check","clean:dist":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"","example:list":"node scripts/run-example.mjs --list","check:package":"node scripts/check-package.mjs","smoke:runtime":"pnpm run build && node scripts/smoke-runtime.mjs","build:examples":"pnpm run build && pnpm run clean:examples && tsc -p tsconfig.examples.json","check:examples":"pnpm run build && pnpm run check:examples:built","clean:examples":"node -e \"require('node:fs').rmSync('dist-test/examples-build', { recursive: true, force: true })\"","example:append":"pnpm run example -- append","example:catalog":"pnpm run example -- catalog","example:statement":"pnpm run example -- statement","smoke:web-runtime":"pnpm run build && node scripts/smoke-runtime.mjs --without-buffer","example:append-bulk":"pnpm run example -- append-bulk","check:examples:built":"tsc -p tsconfig.examples.json --noEmit && pnpm run check:package","example:append-stream":"pnpm run example -- append-stream","example:append-telemetry":"pnpm run example -- append-telemetry","example:ingest-transform":"pnpm run example -- ingest-transform"},"_npmUser":{"name":"leiysky","email":"leiysky@outlook.com"},"repository":{"url":"git+https://github.com/scopedb/scopedb-js.git","type":"git"},"_npmVersion":"11.8.0","description":"A TypeScript-first ScopeDB client for server-side JavaScript runtimes","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.32.1","devDependencies":{"typescript":"^5.8.2","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/scopedb_0.2.0_1785993907242_0.5011370558237234","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"scopedb","version":"0.2.1","keywords":["scopedb","scopeql","database","analytics","observability","typescript","nextjs","bun","serverless"],"license":"Apache-2.0","_id":"scopedb@0.2.1","maintainers":[{"name":"tisonkun","email":"wander4096@gmail.com"},{"name":"leiysky","email":"leiysky@outlook.com"}],"homepage":"https://docs.scopedb.io/developer/nodejs","bugs":{"url":"https://github.com/scopedb/scopedb-js/issues"},"dist":{"shasum":"e3928fe73ef4419d2420f40ccb09f4a9fe95a5da","tarball":"https://registry.npmjs.org/scopedb/-/scopedb-0.2.1.tgz","fileCount":57,"integrity":"sha512-GUBIVbBvA8nK0hPekkr+LEqgnPCmoxIvZ+BTbnEaIqgDWcZt5pZujuhw0s5KmXZanE1n4xsPU+NUKmrOdvCIjQ==","signatures":[{"sig":"MEYCIQDXhuaCMowo4qy0js+zBKm+11QbAem7Dc0lL+DH7VMVzAIhAIeBLgJ71UfVpReInRfAO5/EZElB22F3jLrmNUv/zEq9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":334595},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"bc1a6b6c39f08bf97ab500df20a4e5e78b9ceb68","scripts":{"test":"tsc -p tsconfig.test.json --noEmit && tsc -p tsconfig.test.json && node --test dist-test/tests/*.test.js","build":"pnpm run clean:dist && tsc -p tsconfig.json","check":"pnpm run build && pnpm run check:examples:built","example":"pnpm run build:examples && node scripts/run-example.mjs","prepack":"pnpm run test && pnpm run check","clean:dist":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"","example:list":"node scripts/run-example.mjs --list","check:package":"node scripts/check-package.mjs","smoke:runtime":"pnpm run build && node scripts/smoke-runtime.mjs","build:examples":"pnpm run build && pnpm run clean:examples && tsc -p tsconfig.examples.json","check:examples":"pnpm run build && pnpm run check:examples:built","clean:examples":"node -e \"require('node:fs').rmSync('dist-test/examples-build', { recursive: true, force: true })\"","example:append":"pnpm run example -- append","example:catalog":"pnpm run example -- catalog","example:statement":"pnpm run example -- statement","smoke:web-runtime":"pnpm run build && node scripts/smoke-runtime.mjs --without-buffer","example:append-bulk":"pnpm run example -- append-bulk","check:examples:built":"tsc -p tsconfig.examples.json --noEmit && pnpm run check:package","example:append-stream":"pnpm run example -- append-stream","example:append-telemetry":"pnpm run example -- append-telemetry","example:ingest-transform":"pnpm run example -- ingest-transform"},"_npmUser":{"name":"leiysky","email":"leiysky@outlook.com"},"repository":{"url":"git+https://github.com/scopedb/scopedb-js.git","type":"git"},"_npmVersion":"11.8.0","description":"A TypeScript-first ScopeDB client for server-side JavaScript runtimes","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.32.1","devDependencies":{"typescript":"^5.8.2","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/scopedb_0.2.1_1787161035007_0.6030427015680857","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"scopedb","version":"0.2.2","description":"A TypeScript-first ScopeDB client for server-side JavaScript runtimes","keywords":["scopedb","scopeql","database","analytics","observability","typescript","nextjs","bun","serverless"],"homepage":"https://docs.scopedb.io/developer/nodejs","repository":{"type":"git","url":"git+https://github.com/scopedb/scopedb-js.git"},"bugs":{"url":"https://github.com/scopedb/scopedb-js/issues"},"license":"Apache-2.0","type":"module","sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"engines":{"node":">=20"},"scripts":{"build":"pnpm run clean:dist && tsc -p tsconfig.json","build:examples":"pnpm run build && pnpm run clean:examples && tsc -p tsconfig.examples.json","check":"pnpm run build && pnpm run check:examples:built","check:examples":"pnpm run build && pnpm run check:examples:built","check:examples:built":"tsc -p tsconfig.examples.json --noEmit && pnpm run check:package","check:package":"node scripts/check-package.mjs","smoke:runtime":"pnpm run build && node scripts/smoke-runtime.mjs","smoke:web-runtime":"pnpm run build && node scripts/smoke-runtime.mjs --without-buffer","clean:dist":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"","clean:examples":"node -e \"require('node:fs').rmSync('dist-test/examples-build', { recursive: true, force: true })\"","example":"pnpm run build:examples && node scripts/run-example.mjs","example:list":"node scripts/run-example.mjs --list","example:append":"pnpm run example -- append","example:append-stream":"pnpm run example -- append-stream","example:append-bulk":"pnpm run example -- append-bulk","example:append-telemetry":"pnpm run example -- append-telemetry","example:catalog":"pnpm run example -- catalog","example:ingest-transform":"pnpm run example -- ingest-transform","example:statement":"pnpm run example -- statement","prepack":"pnpm run test && pnpm run check","test":"tsc -p tsconfig.test.json --noEmit && tsc -p tsconfig.test.json && node --test dist-test/tests/*.test.js"},"devDependencies":{"@types/node":"^25.5.0","typescript":"^5.8.2"},"packageManager":"pnpm@10.32.1","gitHead":"e4ecc88798b5bef6ef95d866fa794b3f3e0256bf","_id":"scopedb@0.2.2","_nodeVersion":"24.12.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-2+7kb2VCQ+73/7BGRH7+ei6DLfKAdU5KsEAyaDx9U9KT3CLpgy9XXQHD9crnE3U1T+TiAYg9eQ9UbITdn90QPQ==","shasum":"9f6753685c8c38cd8224350ed062f4258dcf51b0","tarball":"https://registry.npmjs.org/scopedb/-/scopedb-0.2.2.tgz","fileCount":57,"unpackedSize":334733,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDxCglxdIwv25myo7SC/JgFCx4qaFJ1ov3butROglRRPAIgYBGhasqJkgNryx7NFHwPbvQXLA/REljOzD2yg4vIZTQ="}]},"_npmUser":{"name":"leiysky","email":"leiysky@outlook.com"},"directories":{},"maintainers":[{"name":"tisonkun","email":"wander4096@gmail.com"},{"name":"leiysky","email":"leiysky@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/scopedb_0.2.2_1787338714671_0.8269893866915452"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-15T16:54:00.772Z","modified":"2026-08-21T18:58:34.977Z","0.0.1":"2026-03-15T16:54:01.015Z","0.0.2":"2026-05-24T07:59:35.203Z","0.0.3":"2026-07-15T14:04:44.794Z","0.1.0":"2026-08-05T09:33:02.629Z","0.1.1":"2026-08-05T14:39:18.146Z","0.2.0":"2026-08-06T05:25:07.384Z","0.2.1":"2026-08-19T17:37:15.154Z","0.2.2":"2026-08-21T18:58:34.839Z"},"bugs":{"url":"https://github.com/scopedb/scopedb-js/issues"},"license":"Apache-2.0","homepage":"https://docs.scopedb.io/developer/nodejs","keywords":["scopedb","scopeql","database","analytics","observability","typescript","nextjs","bun","serverless"],"repository":{"type":"git","url":"git+https://github.com/scopedb/scopedb-js.git"},"description":"A TypeScript-first ScopeDB client for server-side JavaScript runtimes","maintainers":[{"name":"tisonkun","email":"wander4096@gmail.com"},{"name":"leiysky","email":"leiysky@outlook.com"}],"readme":"# ScopeDB JavaScript SDK\n\nThis package provides a TypeScript-first ScopeDB client for trusted server-side\nJavaScript runtimes. It is ESM-only and has no runtime dependencies.\n\n## Runtime support\n\n| Environment | Recommended usage |\n| --- | --- |\n| Node.js 20+ | Native ESM; Node 20 is a compatibility floor, so use a maintained Node LTS release in production |\n| Next.js | Route Handlers, Server Actions, and other `server-only` modules; prefer the Node runtime |\n| Bun | Use the same ESM API and `bun add scopedb`; no Bun-specific adapter |\n| Cloudflare Workers | Use secret bindings and Web APIs; `nodejs_compat` is not required |\n| CommonJS | Load the ESM package with dynamic `import()` |\n\nDo not use this SDK from browser code, Next.js Client Components, or other\nuntrusted clients. A ScopeDB API key grants server access and must not be\nincluded in a browser bundle. The [Next.js](examples/frameworks/nextjs-route-handler/route.ts)\nand [Cloudflare Worker](examples/frameworks/cloudflare-worker/worker.ts)\ntemplates show the intended boundary.\n\n## ScopeQL documentation\n\nThis SDK executes ScopeQL statements; the language is documented separately:\n\n- [Quickstart](https://docs.scopedb.io/guides/quickstart)\n- [Query guide](https://docs.scopedb.io/guides/query-events)\n- [Language reference](https://docs.scopedb.io/reference/)\n\n## Installation\n\n```sh\npnpm add scopedb\n# or: npm install scopedb\n# or: bun add scopedb\n```\n\n## Create a Client\n\n```ts\nimport { Client } from \"scopedb\";\n\nconst client = new Client(process.env.SCOPEDB_ENDPOINT!, {\n  apiKey: process.env.SCOPEDB_API_KEY!,\n});\n```\n\nThe SDK compresses JSON request bodies and `AppendStream` batches with gzip by\ndefault using the Web Compression API. Direct caller-encoded table appends\nremain identity-encoded.\n\n## Run a Statement\n\n```ts\nimport { Client } from \"scopedb\";\n\nconst client = new Client(process.env.SCOPEDB_ENDPOINT!, {\n  apiKey: process.env.SCOPEDB_API_KEY!,\n});\n\nconst result = await client.query(\"SELECT 1 AS ready\");\nconsole.log(result.toObjects());\n```\n\nFor a detached or long-running statement, keep its handle and choose between a\nlocal snapshot, one remote status request, or waiting for the result:\n\n```ts\nconst handle = await client.statement(\"SELECT 1 AS ready\").submit();\n\n// Synchronous and local: the snapshot updated by submit(), status(), or wait().\nconsole.log(handle.lastStatus()?.status);\n\n// Asynchronous: requests the latest remote status while the statement is active.\nconst latest = await handle.status();\nconsole.log(latest.status);\n\n// Polls until the statement terminates and returns its result set.\nconst result = await handle.wait();\n```\n\n`status()` returns the cached snapshot without another request once the handle\nhas reached a terminal state. Use `client.statementHandle(id)` to resume this\nlifecycle from a previously stored statement ID. `wait()`, `query()`, and\n`execute()` accept `WaitOptions` when polling delays or cancellation need to be\nconfigured.\n\n## Integer Representation\n\n`int` and `uint` cells default to JS `bigint` to preserve full I64 precision.\nThis is the safe default but is **not** directly JSON-serializable —\n`JSON.stringify(rowWithBigInt)` throws `TypeError: Do not know how to serialize\na BigInt`.\n\n`toValues()`, `toObjects()`, and `first()` accept an optional\n`{ integerMode }` to opt in to a different representation:\n\n```ts\n// Default: bigint (lossless, NOT JSON-safe)\nconst rowsBigint = result.toObjects();\n\n// JSON-safe number. Loses precision for |x| > Number.MAX_SAFE_INTEGER\n// (i.e. 2**53 - 1). Safe for typical count() / bounded counters.\nconst rowsNumber = result.toObjects({ integerMode: \"number\" });\nJSON.stringify(rowsNumber); // ok\n\n// Decimal string. Always safe, always JSON-safe.\n// Recommended for unbounded I64 identifiers.\nconst rowsString = result.toObjects({ integerMode: \"string\" });\n```\n\nThe option only affects `int` / `uint` columns; other types are unchanged.\n\n## Table Helper\n\n```ts\nimport { Client } from \"scopedb\";\n\nconst table = client.table(\"events\", {\n  database: \"scopedb\",\n  schema: \"public\",\n});\n\nconst description = await table.describe();\nconsole.log(description.columns);\n```\n\n## Streaming Writes with NDJSON\n\nThe streaming write API accepts newline-delimited JSON. The table helper\nuses `scopedb` and `public` when the database or schema is not specified.\nThe destination table must already exist. Use an explicit disposable table for\nthe snippets before pointing any write path at production.\n\n```ts\nimport { Client } from \"scopedb\";\n\nconst table = client.table(\"sdk_example_events\", {\n  database: \"scopedb\",\n  schema: \"public\",\n});\n\nconst result = await table.append(\n  [\n    JSON.stringify({ id: 1, name: \"first\" }),\n    JSON.stringify({ id: 2, name: \"second\" }),\n  ].join(\"\\n\"),\n);\n\nconsole.log(result.num_rows_inserted);\n```\n\nFor continuous producers, use the asynchronous append stream. It serializes\neach record as one NDJSON line, batches by size or time, applies byte-based\nbackpressure, and sends a bounded number of append requests concurrently.\n\n```ts\nconst stream = table\n  .appendStream()\n  .targetBatchBytes(4 * 1024 * 1024)\n  .maxBatchRows(10_000)\n  .flushIntervalMs(1_000)\n  .maxConcurrentBatches(4)\n  .maxBufferedBytes(64 * 1024 * 1024)\n  .build();\n\nconst accepted = await stream.sendAll([\n  { id: 1, name: \"first\" },\n  { id: 2, name: \"second\" },\n]);\nconsole.log(accepted.acceptedRows);\n\n// A commit barrier for all rows accepted before flush().\nawait stream.flush();\n\n// Flushes remaining rows and waits for all in-flight requests. Repeated calls\n// return the same promise.\nawait stream.shutdown();\n```\n\n`send()` waits only for local admission capacity; it does not wait for a remote\ncommit. `sendAll()` consumes an iterable or async iterable one row at a time\nwith the same admission backpressure. Avoid creating one promise per row with\n`Promise.all()`: those promises and their serialized rows can outgrow the\nstream's bounded buffer. `flush()` and `shutdown()` are the remote delivery\nbarriers.\n\nMore precisely, a successful barrier in the default `\"stop\"` mode confirms\nthat its accepted prefix committed. In `\"continue\"` mode it is a settlement\nbarrier: inspect its report because some batches may be rejected, unknown, or\ndropped while later batches continue.\n\nThe default `failurePolicy` is `\"stop\"`, which preserves fail-fast behavior\nand returns the existing `AppendRowsResult | null` from barriers. Best-effort\ntelemetry must opt in when creating the stream with\n`.appendStream({ failurePolicy: \"continue\" })`. Its barriers return an\n`AppendDeliveryReport` with committed, failed, unknown, and locally dropped row\ncounts. `failedRows` includes explicitly rejected rows and rows that a local\nfatal stream failure prevented from being delivered; ambiguous outcomes remain\nseparate in `unknownRows`. `outcome` is `\"partial\"` when at least one row\ncommitted but others were lost or remain unknown. With no committed rows it is\n`\"unknown\"` if any batch may have committed, otherwise `\"failed\"`; only a\nloss-free report is `\"ok\"`. Never blindly replay an `\"unknown\"` report. In every\ncompleted report:\n\n```text\nacceptedRows = committedRows + failedRows + unknownRows\n```\n\nThe stream automatically retries only the exact HTTP batch when its temporary\nerror is explicitly marked `append_state: \"rejected\"`. That does not make the\nwhole stream or source safe to replay: other concurrent batches may already be\ncommitted. A transport error or attempt timeout is `unknown`; the SDK reports\nthat batch without retrying it, then continue mode can process later batches.\nContinue mode releases a failed batch after reporting it; it is not an in-memory\nretry queue. Use an external spool/outbox when the payload must remain available\nfor replay or reconciliation. Safe retries honor `Retry-After`, capped by the\nconfigured maximum backoff.\n\n### Choose a delivery path\n\n| Workload | Admission and delivery | Example |\n| --- | --- | --- |\n| One exact NDJSON payload | Caller owns request boundaries | [`append.ts`](examples/append.ts) |\n| Basic asynchronous batching | SDK owns batch boundaries; default strict barriers | [`append-stream.ts`](examples/append-stream.ts) |\n| Backfill or file import | Bounded backpressure and concurrent strict batches | [`bulk-import.ts`](examples/patterns/bulk-import.ts) |\n| Long-running logs and events | Continue-mode stream with observable loss | [`telemetry.ts`](examples/patterns/telemetry.ts) |\n| Fetch-style Serverless | Warm stream settled through a lifecycle hook | [`serverless.ts`](examples/templates/serverless.ts) |\n| Durable audit records | One durable attempt per request; ambiguous commits require reconciliation | [`audit-outbox.ts`](examples/templates/audit-outbox.ts) |\n\nFor long-running telemetry, `trySend()` attempts local admission without\nwaiting; a `true` result still does not mean a remote commit. A `false` result\ncan mean a full buffer, open circuit, invalid or oversized input, or a closed\nstream; `stats().droppedByReason` separates those causes. Continue mode's\ndefault circuit opens after five consecutive availability failures and probes\nagain after 30 seconds. Its default attempt timeout is also 30 seconds.\n\nFor Serverless, register the real `flush()` promise with a lifecycle hook such\nas `waitUntil()`; a per-attempt `attemptTimeoutMs()` does not bound the whole\nbarrier or a shared backlog. A report from a module-level stream can cover\nconcurrent invocations, so it is not an attribution receipt for one event.\n\nFor audit data, an in-memory stream is not a durable queue and stable IDs do not\nautomatically provide idempotency. One durable outbox checkpoint should map to\none size-validated NDJSON request unless the application stores per-request\nreceipts. An `unknown` result may already have committed and must not be blindly\nreplayed. Persist `READY -> ATTEMPTING` before the request; after a crash, route\nan incomplete `ATTEMPTING` record to reconciliation instead of appending it\nagain.\n\nAn `AbortSignal` passed to `send()` or `sendAll()` cancels only rows still\nwaiting for local admission. Already accepted rows remain in the stream. For\n`flush()` and `shutdown()`, aborting stops the caller's wait but does not cancel\nan in-flight append, because doing so would create another unknown outcome.\nLifetime results remain available from `stats()`; the latest completed\ncontinue-mode barrier is also exposed as `stats().lastReport`.\n\nIf `sendAll()` is cancelled or its input iterator throws, previously accepted\nrows are not rolled back and may already have been dispatched. Call\n`shutdown()` when the accepted prefix should still commit; there is no\ntransactional stream-wide abort or rollback.\n\nThe default number of concurrent batches is 4. Set\n`.maxConcurrentBatches(1)` when batches must be submitted serially; concurrent\nbatches do not have a defined commit order. `AppendStream` caps each uncompressed\nNDJSON request at 8 MiB and 200,000 rows, and splits automatically at either\nlimit. Direct caller-encoded appends retain the endpoint's 16 MiB limit.\n\nRemote append failures and ambiguous commit outcomes throw `AppendRowsError`.\nIts `appendState`, `rowErrors`, and `rowErrorsTruncated` fields preserve the\nstructured response. An `appendState` of `\"unknown\"` means the commit outcome\ncannot be determined; retrying the same payload may insert duplicates. The\nstream retries only the exact temporary HTTP batch that the server explicitly\nmarks as `\"rejected\"`.\n\n## Browse the Catalog\n\nThe RESTful catalog methods return database, schema, table-summary, and full\ntable resources. Use async iterators for the common path; list methods remain\navailable when an application needs explicit page boundaries.\n\n```ts\nfor await (const database of client.iterateDatabases({ pageSize: 100 })) {\n  console.log(database.name);\n}\n\nfor await (\n  const table of client.iterateTables({\n    database: \"scopedb\",\n    schema: \"public\",\n    pageSize: 100,\n  })\n) {\n  console.log(table.name);\n}\n```\n\n## Errors\n\nServer messages pass through unchanged. `ScopeDBError` adds structured\ndiagnostics without requiring callers to parse the message:\n\n```ts\nimport { ScopeDBError } from \"scopedb\";\n\ntry {\n  await client.query(\"SELECT 1\");\n} catch (error) {\n  if (error instanceof ScopeDBError) {\n    console.error({\n      message: error.message,\n      httpStatus: error.httpStatus,\n      requestId: error.requestId,\n      retryable: error.retryable,\n      retryAfterMs: error.retryAfterMs,\n    });\n  }\n  throw error;\n}\n```\n\n## CommonJS applications\n\nThe package is ESM-only. CommonJS applications can load it with dynamic import:\n\n```js\nasync function main() {\n  const { Client } = await import(\"scopedb\");\n  // ...\n}\n\nvoid main();\n```\n\n## Batched JSON Ingest\n\nThis is also a write path: create the target first and use a disposable table\nwhile evaluating the example.\n\n```ts\nimport { Client } from \"scopedb\";\n\nconst client = new Client(process.env.SCOPEDB_ENDPOINT!, {\n  apiKey: process.env.SCOPEDB_API_KEY!,\n});\n\nconst stream = client\n  .ingestStream(`\n    SELECT\n      $0[\"ts\"]::timestamp AS occurred_at,\n      $0[\"name\"]::string AS name\n    INSERT INTO public.sdk_example_events (occurred_at, name)\n  `)\n  .build();\n\nawait stream.send({\n  ts: \"2026-03-13T12:00:00Z\",\n  name: \"scopedb\",\n});\n\nawait stream.flush();\nawait stream.shutdown();\n```\n\n## Examples\n\nSee the runnable instructions and delivery rules in\n[`examples/README.md`](examples/README.md).\n\nAll examples import the public `scopedb` package entry and are checked with:\n\n```sh\npnpm run check:examples\n```\n\n## Development\n\n```sh\npnpm test\npnpm run build\npnpm run check\n```\n\n## Delivery Notes\n\n- The package is TypeScript-first and emits declarations from `src/index.ts`.\n- Generated artifacts stay out of git; `dist/`, `dist-test/`, and\n  `node_modules/` are ignored.\n- `prepack` runs unit, type, example, and package-entry checks before creating\n  a publishable tarball.\n","readmeFilename":"README.md"}