Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

random-access-web

Package Overview
Dependencies
17
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.1.0

26

index.js

@@ -6,8 +6,24 @@ const global = (typeof window !== 'undefined') ? window : self;

const DEFAULT_DB_NAME = 'random-access-web'
let init = async (options={}) => {
if(typeof options === 'string') options = {name: options}
const name = options.name || DEFAULT_DB_NAME
return require('random-access-idb')(name)
}
if(requestFileSystem) {
module.exports = require('random-access-chrome-file')
} else if(mutableFile) {
module.exports = require('@sammacbeth/random-access-idb-mutable-file')
} else {
module.exports = require('random-access-idb')
init = async (options) => {
return require('random-access-chrome-file')
}
} else if(mutableFile) {
init = async (options) => {
const RandomAccess = require('@sammacbeth/random-access-idb-mutable-file')
return RandomAccess.mount()
}
}
module.exports = {
init
}

2

package.json
{
"name": "random-access-web",
"version": "1.0.0",
"version": "1.1.0",
"description": "Chooses the fastest random access backend based on the user's browser",

@@ -5,0 +5,0 @@ "main": "index.js",

# random-access-web
Chooses the fastest random access backend based on the user's browser
```shell
npm install --save random-access-web
```
```js
const RandomAccessWeb = require('random-access-web')
const storage = await RandomAccessWeb.init()
const dat = new DatJs({
db: storage
})
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc