Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Provide clientside multiplayer and optimistic updates over any s3-compatible storage API
⚠️ Under development
An offline-first browser database over any S3-compatible API.
Tested with S3, Backblaze, R2 and self-hosted solutions like Minio (running examples).
MPS3 is a key-value document store. A manifest lists all keys in the DB as references to files hosted on s3. Setting a key first writes the content to storage, then updates the manifest. To enable subscriptions, the client polls the manifest for changes. To enable causally consistent concurrent writes, the manifest is represented as a time indexed log of patches and checkpoints which is resolved on read.
Manifests should not contain too many keys as it adds overheads. A manifest should encapsule a single consistency boundary (e.g. a channel in a chat). You can share keys between multiple manifests and move keys in, out and across, manifests lightly (TODO).
To use this library you construct an MP3S class.
import {MPS3} from 'https://cdn.skypack.dev/mps3@0.0.58?min';
const mps3 = new MPS3({
defaultBucket: "<BUCKET>",
s3Config: {
region: "<REGION>",
credentials: {
accessKeyId: "<ACCESS_KEY>",
secretAccessKey: "<SECRET_KEY>"
}
}
});
mps3.put("key", "myValue"); // can await for confirmation
mps3.subscribe("key", (val) => console.log(val)); // causally consist listeners
const value = await mps3.get("key"); // read-after-write consist
For the client to work properly some CORS configuration is required on the bucket so the Javascript environment can observe relevant metadata.
[{
"AllowedHeaders": ["*"],
"AllowedMethods": ["GET", "PUT", "POST", "DELETE"],
"AllowedOrigins": ["*"],
"ExposeHeaders": ["X-Amz-Version-Id", "ETag"]
}]
There is no in-built authorization. Every use-case needs different authorization. A malicious user could sabotage the manifest file if they have unrestricted write permissions to the manifest file, but not all use-cases have malicious users. There are a few options:-
Consult the API Documentation for advanced usage.
FAQs
Provide clientside multiplayer and optimistic updates over any s3-compatible storage API
The npm package mps3 receives a total of 8 weekly downloads. As such, mps3 popularity was classified as not popular.
We found that mps3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.