Socket
Socket
Sign inDemoInstall

orbit-db-storage-adapter

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orbit-db-storage-adapter - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

customDir/000003.log

11

conf/webpack.config.js

@@ -7,2 +7,3 @@ 'use strict'

module.exports = {
mode: 'production',
entry: './src/index.js',

@@ -15,3 +16,3 @@ output: {

target: 'web',
devtool: 'none',
devtool: 'source-map',
externals: {

@@ -21,7 +22,2 @@ fs: '{}',

},
node: {
console: false,
Buffer: true,
mkdirp: 'empty'
},
plugins: [

@@ -48,4 +44,5 @@ new webpack.DefinePlugin({

],
moduleExtensions: ['-loader']
extensions: ['.js', '.json'],
mainFields: ['loader', 'main']
}
}

@@ -22,3 +22,10 @@ 'use strict'

}),
new webpack.IgnorePlugin(/mongo|redis/)
new webpack.IgnorePlugin({
resourceRegExp: /mongo|redis/,
contextRegExp: /mongo|redis/
}),
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer']
})
],

@@ -33,4 +40,2 @@ externals: {

dns: '{}'
// path: '{}',
// "node-gyp-build": '{}'
},

@@ -41,3 +46,8 @@ resolve: {

path.resolve(__dirname, '../node_modules')
]
],
fallback: {
buffer: require.resolve('buffer'),
path: false,
os: false
}
},

@@ -49,3 +59,4 @@ resolveLoader: {

],
moduleExtensions: ['-loader']
extensions: ['.js', '.json'],
mainFields: ['loader', 'main']
},

@@ -52,0 +63,0 @@ module: {

{
"name": "orbit-db-storage-adapter",
"version": "0.6.0",
"version": "0.7.0",
"description": "OrbitDB adapter for any abstract-leveldown compliant storage",

@@ -41,3 +41,3 @@ "main": "./src/index.js",

"level": "^7.0.0",
"mkdirp": "^0.5.1"
"mkdirp": "^1.0.4"
},

@@ -53,17 +53,14 @@ "devDependencies": {

"babel-loader": "^8.0.6",
"fruitdown": "^1.0.2",
"jsondown": "^1.0.0",
"localstorage-down": "^0.6.7",
"memdown": "^6.0.0",
"mocha": "^6.1.4",
"mocha-headless-chrome": "^3.1.0",
"buffer": "^6.0.3",
"memdown": "^6.1.1",
"mocha": "^10.0.0",
"mocha-headless-chrome": "^4.0.0",
"mongo-unit": "^2.0.1",
"mongodb-memory-server": "^6.9.6",
"mongodown": "^2.0.0",
"redis-server": "^1.2.2",
"redisdown": "^0.1.12",
"standard": "^16.0.3",
"webpack": "^4.32.0",
"webpack-cli": "^3.3.2"
"process": "^0.11.10",
"standard": "^17.0.0",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
}
}

@@ -12,6 +12,2 @@ # OrbitDB Storage Adapter

- **[`level-js`](https://github.com/Level/level.js)**
- **[`jsondown`](https://github.com/toolness/jsondown)**
- **[`fruitdown`](https://github.com/nolanlawson/fruitdown)**
- **[`localstorage-down`](https://github.com/No9/localstorage-down)**
- **[`localdown`](https://github.com/bhoriuchi/localdown)**

@@ -18,0 +14,0 @@ [Help is wanted](https://github.com/orbitdb/orbit-db-storage-adapter/issues/3) to support more stores!

@@ -36,48 +36,37 @@ 'use strict'

createStore (directory = './orbitdb', options = {}) {
// TODO: Refactor to not use async Promise executor
return new Promise(async (resolve, reject) => { /* eslint-disable-line */
this.options.up = options
await this.preCreate(directory, this.options)
let store, db
async createStore (directory = './orbitdb', options = {}) {
this.options.up = options
await this.preCreate(directory, this.options)
let store, db
if (this.storage) {
db = this.storage(directory, this.options.down)
if (this.storage) {
db = this.storage(directory, this.options.down)
// For compatibility with older abstract-leveldown stores
if (!db.status) db.status = 'unknown-shim'
if (!db.location) db.location = directory
// For compatibility with older abstract-leveldown stores
if (!db.status) db.status = 'unknown-shim'
if (!db.location) db.location = directory
store = levelup(db, options)
store.open((err) => {
if (err) {
return reject(err)
}
store = levelup(db, options)
await store.open() // TODO: Is this necessary? https://www.npmjs.com/package/levelup says it is only necessary when reopening a closed db.
// More backwards compatibility
if (db && db.status === 'unknown-shim') db.status = 'open'
resolve(store)
})
} else {
// Default leveldown or level-js store with directory creation
if (fs && fs.mkdirSync) fs.mkdirSync(directory, { recursive: true })
const db = level(directory, options)
await db.open()
resolve(db)
}
})
// More backwards compatibility
db.status = db && db.status === 'unknown-shim' ? 'open' : db.status
return store // should this not be db?
} else {
// Default leveldown or level-js store with directory creation
if (fs && fs.mkdirSync) fs.mkdirSync(directory, { recursive: true })
const db = level(directory, options)
await db.open()
return db
}
}
destroy (store) {
return new Promise((resolve, reject) => {
// TODO: Clean this up
if (!this.storage.destroy) resolve()
async destroy (store) {
if (!this.storage.destory) return
this.storage.destroy(store._db.location, (err) => {
if (err) {
return reject(err)
}
resolve()
})
})
await this.storage.destory(store._db.location)
}

@@ -84,0 +73,0 @@

@@ -11,13 +11,13 @@ module.exports = [

module: require('memdown')
},
{
key: 'localdown',
type: 'browser',
module: require('localstorage-down')
},
{
key: 'fruitdown',
type: 'browser',
module: require('fruitdown')
}
// {
// key: 'localdown',
// type: 'browser',
// module: require('localstorage-down')
// },
// {
// key: 'fruitdown',
// type: 'browser',
// module: require('fruitdown')
// }
]

@@ -15,13 +15,2 @@ // const mongoUnit = require('mongo-unit')

module: require('memdown')
},
{
key: 'localdown',
type: 'node',
module: require('localstorage-down')
},
{
key: 'jsondown',
type: 'node',
module: require('jsondown'),
fileName: 'orbitdb.json'
}

@@ -40,25 +29,2 @@ // Disabling for now since it was breaking CI builds, but keep it available

// },
// {
// key: 'redisdown',
// type: 'node',
// module: require('redisdown'),
// server: {
// start: () => {
// return new Promise((resolve, reject) => {
// const server = new RedisServer(6379);
// server.open((err) => {
// if (err === null) {
// reject(err)
// }
// resolve()
// })
// })
// },
// afterEach: async () => {},
// stop: async () => {
// const server = new RedisServer(6379);
// server.stop()
// }
// }
// }
]

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc