{"name":"@pnpm/store.index","version":"1100.2.5","keywords":["pnpm","pnpm11","store"],"license":"MIT","_id":"@pnpm/store.index@1100.2.5","maintainers":[{"name":"pnpmuser","email":"publish-bot@pnpm.io"},{"name":"zkochan","email":"z@kochan.io"}],"homepage":"https://github.com/pnpm/pnpm/tree/main/pnpm11/store/index#readme","bugs":{"url":"https://github.com/pnpm/pnpm/issues"},"dist":{"shasum":"ac90a8d6d7ea4ae4c3f1fa9a2c14ab1cb3a96c61","tarball":"http://registry-npm.ywwl.com/@pnpm/store.index/download/@pnpm/store.index-1100.2.5.tgz","fileCount":6,"integrity":"sha512-oHA9lrQ+bk+I43SeghQ3X6pV9TeUb1JXzY1xxwcsU9iKzfYAXgzTaftmSJSKBReFDG1U1CWKGtRg7b8NLNSiYA==","signatures":[{"sig":"MEQCIEprI3r1MFXW3ERNiUKjXmRkXMKjn0kYmxz3G7XIkNKEAiBYhGEDKOQB2qUiCw2V0e3AF8/vuNzxmJFTMJ5Xtp9Ozg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pnpm%2fstore.index@1100.2.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":23970,"size":7422,"noattachment":false,"key":"/@pnpm/store.index/-/@pnpm/store.index-1100.2.5.tgz"},"jest":{"preset":"@pnpm/jest-config"},"main":"lib/index.js","type":"module","types":"lib/index.d.ts","engines":{"node":">=22.13"},"exports":{".":"./lib/index.js"},"funding":"https://opencollective.com/pnpm","scripts":{"lint":"eslint \"src/**/*.ts\" \"test/**/*.ts\"","test":"pn compile && pn .test",".test":"cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest","compile":"tsgo --build && pn lint --fix"},"_npmUser":{"name":"pnpmuser","email":"publish-bot@pnpm.io"},"repository":{"url":"https://github.com/pnpm/pnpm/tree/main/pnpm11/store/index","type":"git"},"description":"SQLite-backed index for the pnpm content-addressable store","directories":{},"dependencies":{"msgpackr":"2.0.5","@pnpm/error":"1100.1.3"},"_hasShrinkwrap":false,"devDependencies":{"tempy":"3.0.0","@types/node":"^22.19.19","@jest/globals":"30.4.1","@pnpm/store.index":"1100.2.5"},"_npmOperationalInternal":{"tmp":"tmp/store.index_1100.2.5_1787494676020_0.24501046894611012","host":"s3://npm-registry-packages-npm-production"},"readme":"# @pnpm/store.index\n\n> SQLite-backed index for the pnpm content-addressable store\n\n## Why SQLite instead of individual index files?\n\nPreviously, pnpm stored package metadata as individual JSON files under\n`$STORE/index/`. Each resolved package had its own file, keyed by its integrity\nhash. This worked but had several downsides at scale:\n\n- **Filesystem overhead.** Every lookup required `open` / `read` / `close`\n  syscalls, and every write needed an atomic `write` + `rename` per entry.\n  On repositories with thousands of dependencies the accumulated I/O was\n  significant.\n- **Space inefficiency.** Small metadata entries still consumed a minimum\n  filesystem block each (typically 4 KiB), wasting space.\nStoring all entries in a single SQLite database (`$STORE/index.db`) addresses\nthese issues:\n\n- **Fewer syscalls.** Reads and writes go through SQLite's page cache and\n  memory-mapped I/O instead of individual file operations.\n- **Space efficiency.** Small entries share database pages instead of each\n  occupying a full filesystem block.\n- **Batch writes.** Multiple entries can be inserted in a single transaction,\n  reducing disk flushes.\n\n## Concurrent access\n\n`StoreIndex` and `ReadOnlyStoreIndex` coordinate access through SQLite WAL locking.\nUse `ReadOnlyStoreIndex` to read a store while other connections write to it.\nIt observes committed updates and may create SQLite sidecar files in the store\ndirectory. All processes must use the same local filesystem on the same host;\nsharing the live WAL database across hosts over a network filesystem is unsupported.\n\nUse `ImmutableStoreIndex` only for a finalized store that no process will change,\nsuch as a store shipped in a read-only image. It creates no sidecar files and is\nused by `frozenStore`. Callers that used `ReadOnlyStoreIndex` for finalized\nstores on read-only filesystems must switch to `ImmutableStoreIndex`.\n\n## Incomplete `node:sqlite`\n\nWhen `DatabaseSync.exec` is missing, the store index runs its SQL through prepared statements. When `DatabaseSync.prepare` is missing too, entries are stored in `index.fallback`. A later pnpm with a complete `node:sqlite` reads `index.db` only. `frozenStore` still requires a connection that can open `index.db`. The file index does not coordinate concurrent writers.\n\n## License\n\nMIT\n","publish_time":1787494676158,"_cnpm_publish_time":1787494676158,"dist-tags":{"latest":"1101.0.3"}}