Catalog npm
Back to packageRELEASE DETAILS

0.3.0

npm

3box-shared-cache

The shared cache module that 3box uses to share cache across domains using an iframe

3boxcacheiframeshared-cache
Published4 Aug 2020
Direct dependencies24
Transitive dependenciesNot calculated

README

Current package documentation

3box-shared-cache

"The shared cache module that 3box uses to share cache across domains using an iframe

API

To proxy orbitdb storage or ipfs storage

const { createOrbitStorageProxy, createIpfsStorageProxy } = require('3box-shared-cache')

const proxiedOrbitDbStorage = createOrbitStorageProxt({ postMessage }) // pass proper postMessage instance, (e.g: iframe.contentWindow.postMessage to communicate with iframe)

// pass proxied orbitdb storage to orbit-db-cache or orbit-db-keystore or directly as a storage layer

const proxiedIpfsStorage = createIpfsStorageProxy({ postMessage }) // pass proper postMessage instance, (e.g: iframe.contentWindow.postMessage to communicate with iframe)

// pass proxied ipfs storage as db key in storageBackendOptions to ipfs repo options

Running the server in an iframe

const { createServer } = require('3box-shared-cache')

const server = createServer({ postMessage: window.parent.postMessage })
server.init() // initialises the server
server.start() // start the server
server.stop() // stop the server

How to use with 3box-js

Make sure you have the option iframeCache enabled for 3box-js and make sure you define an environment variable CACHE_IFRAME_URL with the iframe server url

To launch the iframe server, execute:

$ npm run example:server:start

The server will run on http://localhost:30001 by default.

Maintainers

@zachferland

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 24

Native requirements
24 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@babel/runtime
Environment
{
  "local_name": "@babel/runtime",
  "alias": false,
  "peer_metadata": null
}
^7.9.2runtime
abstract-leveldown
Environment
{
  "local_name": "abstract-leveldown",
  "alias": false,
  "peer_metadata": null
}
^6.2.2runtime
datastore-level
Environment
{
  "local_name": "datastore-level",
  "alias": false,
  "peer_metadata": null
}
^1.1.0runtime
level-js
Environment
{
  "local_name": "level-js",
  "alias": false,
  "peer_metadata": null
}
^4.0.2runtime
levelup
Environment
{
  "local_name": "levelup",
  "alias": false,
  "peer_metadata": null
}
^4.3.2runtime
orbit-db-storage-adapter
Environment
{
  "local_name": "orbit-db-storage-adapter",
  "alias": false,
  "peer_metadata": null
}
^0.5.3runtime
postmsg-rpc
Environment
{
  "local_name": "postmsg-rpc",
  "alias": false,
  "peer_metadata": null
}
^2.4.0runtime
@babel/core
Environment
{
  "local_name": "@babel/core",
  "alias": false,
  "peer_metadata": null
}
^7.8.7development
@babel/plugin-transform-runtime
Environment
{
  "local_name": "@babel/plugin-transform-runtime",
  "alias": false,
  "peer_metadata": null
}
^7.9.0development
@babel/preset-env
Environment
{
  "local_name": "@babel/preset-env",
  "alias": false,
  "peer_metadata": null
}
^7.8.7development
@babel/preset-react
Environment
{
  "local_name": "@babel/preset-react",
  "alias": false,
  "peer_metadata": null
}
^7.10.1development
babel-loader
Environment
{
  "local_name": "babel-loader",
  "alias": false,
  "peer_metadata": null
}
^8.0.6development
express
Environment
{
  "local_name": "express",
  "alias": false,
  "peer_metadata": null
}
^4.17.1development
http-server
Environment
{
  "local_name": "http-server",
  "alias": false,
  "peer_metadata": null
}
^0.11.1development
ipfs
Environment
{
  "local_name": "ipfs",
  "alias": false,
  "peer_metadata": null
}
^0.46.0development
ipfs-repo
Environment
{
  "local_name": "ipfs-repo",
  "alias": false,
  "peer_metadata": null
}
^3.0.3development
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^25.1.0development
orbit-db
Environment
{
  "local_name": "orbit-db",
  "alias": false,
  "peer_metadata": null
}
^0.24.1development
orbit-db-cache
Environment
{
  "local_name": "orbit-db-cache",
  "alias": false,
  "peer_metadata": null
}
^0.3.0development
orbit-db-keystore
Environment
{
  "local_name": "orbit-db-keystore",
  "alias": false,
  "peer_metadata": null
}
^0.3.4development
serve-static
Environment
{
  "local_name": "serve-static",
  "alias": false,
  "peer_metadata": null
}
^1.14.1development
standard
Environment
{
  "local_name": "standard",
  "alias": false,
  "peer_metadata": null
}
^14.3.1development
webpack
Environment
{
  "local_name": "webpack",
  "alias": false,
  "peer_metadata": null
}
^4.42.0development
webpack-cli
Environment
{
  "local_name": "webpack-cli",
  "alias": false,
  "peer_metadata": null
}
^3.3.11development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-AkNzAFsJjUwNQ7nbVCOPZpq4/7w+SU8zYPK4nzjJA0C+0DHn3mRrR3DgSa9tEgWEmbE+UmcdKf3Ep5cntT8Gig==",
  "shasum": "06322514d5273da3d80947f213939e4dc4fc2f39",
  "tarball": "https://registry.npmjs.org/3box-shared-cache/-/3box-shared-cache-0.3.0.tgz",
  "fileCount": 18,
  "unpackedSize": 29830,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKMmMCRA9TVsSAnZWagAAtLQP/juxzhfJgfU4ZXi2r42Y\nbHZOoYWmVjPUKWD6oiTpFUWIKYvxPIBaj2nHybrqwTswBQJGMb/sIWs2Q8DA\ng6g5bHD0TyJnhBJR4EZblclmMndjsDY+s6UBfctRJkpbXQWgjs+XTAT0jVOA\nkZhIYNpXKaWXLc1s3VXtFr0BCLNJuQHqldx8K5rTWj+0Js5wmf2XC26HbylR\n0f8SOXWll1L5HaMomrJWwZi2giYmTMFMN8WdIyO5IggZnxnteKR+EtbjiGeU\nTy5/ayPNrHH9yLAsaGxNYEqI/hQlx3Efl3l43sviarm5yBurjL6D4NwqXNaI\n8jztHMAUeYL7sLcFvBtezsPtmkc+7gd65cfiulzIviTaKIN14OwNTGz4EKxW\neY1LSl18HWB86unZSp5HFb30wEcFnieXWXdDtqr2wrwhBBnz+7I4CRIFjffE\npyfeaW2YCFRSqnyxRQBOkomSzyoulLn5dGvIeff6BnqY1w8LKwKCWS0cghEX\n7AFaCxFs+B3dLNDDNlC1fVEp1NITSrZezsDzdXukfVlmVMHdi7Yqs5SzT1a4\nWcluke6/jRtZdA8gsGPKkn7glR/omvEIXUszRjZ3/NYIWcUFsO8mEAxqujjf\ngT+XzFOu/Mve81/+98JHtCx/0XhMTiZfcgHD9XqS75tZufZnSt7TGlPB/0K3\nDZaJ\r\n=DTIb\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIEPyZTfaCZ0ppehiVZsf2zetTbbKYXcuU618b43zA9poAiB7wfrvkjghYPRof2XDEanmdgude0EJ/SwXmeASPGjP/Q=="
    }
  ]
}

Repository

PENDING
3box/3box-shared-cache

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:31 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:32bb5f45de045637dcfc4b0868ffeaed10e5cb96d276ffb3e9ce0a27a07904bb

Other collected versions

1.1.05 Aug0.3.14 Aug0.2.04 AugView all collected versions →