Registry / devops / monosize-storage-upstash

monosize-storage-upstash

JSON →
library0.0.27jsnpmunverified

Monosize storage adapter for Upstash Redis to store bundle size metrics. Current version 0.0.27, released as part of the monosize ecosystem by Microsoft. Release cadence is infrequent, tied to monosize updates. Key differentiator: provides a serverless-compatible Redis backend for monosize CI workflows, supporting read-only tokens for secure access in public repositories.

npm install monosize-storage-upstash
INSTALL
IMPORT
SIG · MONOSIZE-STORAGE-U
M
monosize-storage-upstash
devopsjavascriptv0.0.27
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (upstashStorage)
import upstashStorage from 'monosize-storage-upstash'
const { upstashStorage } = require('monosize-storage-upstash')
Default export, not named. CommonJS require must use default import pattern.
upstashStorage
import upstashStorage from 'monosize-storage-upstash'
TypeScript types are included; no separate type import needed.
StorageConfig (type)
import type { StorageConfig } from 'monosize-storage-upstash'
Available for TypeScript users, but not typically used directly.

Configure monosize to use Upstash Redis for storing bundle size comparisons.

// monosize.config.mjs import upstashStorage from 'monosize-storage-upstash'; export default { repository: 'https://github.com/your-org/your-repo', storage: upstashStorage({ url: process.env.UPSTASH_REDIS_REST_URL ?? '', readonlyToken: process.env.UPSTASH_REDIS_REST_TOKEN ?? '', }), };
Debug
Known issues
gotchaToken must be read-only for security; using a write token can expose Redis to modification if token is leaked.
fix
Generate a read-only token in Upstash console and use that as readonlyToken.
affects: >=0.0.0
gotchaREST URL and token are mandatory; missing them will cause runtime errors.
fix
Ensure both UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN environment variables are set.
affects: >=0.0.0
gotchaAdapter is specifically for monosize; not compatible with other tools.
fix
Use only within a monosize configuration file.
affects: >=0.0.0
Errors
Common errors & fixes
SyntaxError: Cannot use import statement outside a module
Using ES import syntax in a CommonJS file without proper configuration.
fix
Rename file to .mjs or set "type": "module" in package.json.
Error: UPSTASH_REDIS_REST_URL is not defined
Environment variables not set before running monosize.
fix
Set environment variables or pass them inline: UPSTASH_REDIS_REST_URL=... UPSTASH_REDIS_REST_TOKEN=... npx monosize
Upgrade
Version history
0.0.27latest on npm
Audit
Dependencies
monosizerequiredpeer dependency required to work as a storage adapter
Agent activity
4 hits · last 30 days
node
4
Resources
monosize-storage-upstash — npm install monosize-storage-upstash · libregistry