mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-06-07 22:56:36 +00:00
Move webpack conf files to their own directory. Update documentation.
This commit is contained in:
parent
4c0927dc58
commit
c96d9e9b87
24
API.md
24
API.md
@ -1,8 +1,6 @@
|
|||||||
## orbit-db API documentation
|
# orbit-db API documentation
|
||||||
|
|
||||||
**WORK IN PROGRESS**
|
## Table of Contents
|
||||||
|
|
||||||
#### Table of Contents
|
|
||||||
|
|
||||||
- [Getting Started](#getting-started)
|
- [Getting Started](#getting-started)
|
||||||
- [orbitdb](#orbitdb)
|
- [orbitdb](#orbitdb)
|
||||||
@ -31,7 +29,7 @@
|
|||||||
- [orbitdb](#events)
|
- [orbitdb](#events)
|
||||||
- [stores](#events)
|
- [stores](#events)
|
||||||
|
|
||||||
#### Getting Started
|
## Getting Started
|
||||||
|
|
||||||
Install `orbit-db` and [ipfs](https://www.npmjs.com/package/ipfs) from npm:
|
Install `orbit-db` and [ipfs](https://www.npmjs.com/package/ipfs) from npm:
|
||||||
|
|
||||||
@ -67,11 +65,11 @@ const orbitdb = new OrbitDB(ipfs)
|
|||||||
|
|
||||||
Choose this options if you're using `orbitd-db` to develop **Desktop** (or "headless") applications, eg. with [Electron](https://electron.atom.io).
|
Choose this options if you're using `orbitd-db` to develop **Desktop** (or "headless") applications, eg. with [Electron](https://electron.atom.io).
|
||||||
|
|
||||||
#### orbitdb
|
## orbitdb
|
||||||
|
|
||||||
After creating an instance of `orbitd-db`, you can now access the different data stores.
|
After creating an instance of `orbitd-db`, you can now access the different data stores.
|
||||||
|
|
||||||
##### kvstore(name)
|
### kvstore(name)
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const db = orbitdb.kvstore('application.settings')
|
const db = orbitdb.kvstore('application.settings')
|
||||||
@ -101,7 +99,7 @@ After creating an instance of `orbitd-db`, you can now access the different data
|
|||||||
|
|
||||||
See [events](#stores) for full description.
|
See [events](#stores) for full description.
|
||||||
|
|
||||||
##### eventlog(name)
|
### eventlog(name)
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const db = orbitdb.eventlog('site.visitors')
|
const db = orbitdb.eventlog('site.visitors')
|
||||||
@ -136,7 +134,7 @@ After creating an instance of `orbitd-db`, you can now access the different data
|
|||||||
|
|
||||||
See [events](#stores) for full description.
|
See [events](#stores) for full description.
|
||||||
|
|
||||||
##### feed(name)
|
### feed(name)
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const db = orbitdb.feed('orbit-db.issues')
|
const db = orbitdb.feed('orbit-db.issues')
|
||||||
@ -176,7 +174,8 @@ After creating an instance of `orbitd-db`, you can now access the different data
|
|||||||
|
|
||||||
See [events](#stores) for full description.
|
See [events](#stores) for full description.
|
||||||
|
|
||||||
##### counter(name)
|
### counter(name)
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const counter = orbitdb.counter('song_123.play_count')
|
const counter = orbitdb.counter('song_123.play_count')
|
||||||
```
|
```
|
||||||
@ -204,12 +203,13 @@ After creating an instance of `orbitd-db`, you can now access the different data
|
|||||||
|
|
||||||
See [events](#stores) for full description.
|
See [events](#stores) for full description.
|
||||||
|
|
||||||
##### disconnect()
|
### disconnect()
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
orbitdb.disconnect()
|
orbitdb.disconnect()
|
||||||
```
|
```
|
||||||
|
|
||||||
##### events
|
### events
|
||||||
|
|
||||||
- **orbitdb**
|
- **orbitdb**
|
||||||
|
|
||||||
|
@ -81,13 +81,15 @@ npm run examples:node
|
|||||||
<img src="https://raw.githubusercontent.com/haadcode/orbit-db/feat/ipfs-pubsub/screenshots/orbit-db-demo3.gif" width="66%">
|
<img src="https://raw.githubusercontent.com/haadcode/orbit-db/feat/ipfs-pubsub/screenshots/orbit-db-demo3.gif" width="66%">
|
||||||
|
|
||||||
**Eventlog**
|
**Eventlog**
|
||||||
|
|
||||||
Check the code in [examples/eventlog.js](https://github.com/haadcode/orbit-db/blob/master/examples/eventlog.js) and run it with:
|
Check the code in [examples/eventlog.js](https://github.com/haadcode/orbit-db/blob/master/examples/eventlog.js) and run it with:
|
||||||
```
|
```
|
||||||
LOG=debug node examples/eventlog.js
|
LOG=debug node examples/eventlog.js
|
||||||
```
|
```
|
||||||
|
|
||||||
**Key-Value**
|
**Key-Value**
|
||||||
Check the code in [examples/keyvalue.js](https://github.com/haadcode/orbit-db/blob/master/examples/eventlog.js) and run it with:
|
|
||||||
|
Check the code in [examples/keyvalue.js](https://github.com/haadcode/orbit-db/blob/master/examples/keystore.js) and run it with:
|
||||||
```
|
```
|
||||||
LOG=debug node examples/keyvalue.js
|
LOG=debug node examples/keyvalue.js
|
||||||
```
|
```
|
||||||
|
@ -14,12 +14,14 @@ module.exports = {
|
|||||||
process: 'mock',
|
process: 'mock',
|
||||||
Buffer: true
|
Buffer: true
|
||||||
},
|
},
|
||||||
|
plugins: [
|
||||||
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
modules: [
|
modules: [
|
||||||
path.join(__dirname, 'node_modules')
|
path.join(__dirname, '../node_modules')
|
||||||
],
|
],
|
||||||
alias: {
|
alias: {
|
||||||
'fs': path.join(__dirname + '/node_modules', 'html5-fs'),
|
'fs': path.join(__dirname, '../node_modules', 'html5-fs'),
|
||||||
http: 'stream-http',
|
http: 'stream-http',
|
||||||
https: 'https-browserify',
|
https: 'https-browserify',
|
||||||
Buffer: 'buffer'
|
Buffer: 'buffer'
|
@ -20,16 +20,15 @@ module.exports = {
|
|||||||
compress: { warnings: false }
|
compress: { warnings: false }
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
resolveLoader: {
|
|
||||||
modules: [path.join(__dirname, 'node_modules')]
|
|
||||||
},
|
|
||||||
resolve: {
|
resolve: {
|
||||||
modules: [
|
modules: [
|
||||||
path.join(__dirname, 'node_modules')
|
path.join(__dirname, '../node_modules')
|
||||||
],
|
],
|
||||||
alias: {
|
alias: {
|
||||||
'node_modules': path.join(__dirname + '/node_modules'),
|
'fs': path.join(__dirname, '../node_modules', 'html5-fs'),
|
||||||
'fs': path.join(__dirname + '/node_modules', 'html5-fs'),
|
http: 'stream-http',
|
||||||
|
https: 'https-browserify',
|
||||||
|
Buffer: 'buffer'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
@ -2,9 +2,7 @@ const webpack = require('webpack')
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: [
|
entry: './examples/browser/index.js',
|
||||||
'./examples/browser/index.js',
|
|
||||||
],
|
|
||||||
output: {
|
output: {
|
||||||
filename: './examples/browser/bundle.js'
|
filename: './examples/browser/bundle.js'
|
||||||
},
|
},
|
||||||
@ -22,10 +20,10 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
modules: [
|
modules: [
|
||||||
path.join(__dirname, 'node_modules')
|
path.join(__dirname, '../node_modules')
|
||||||
],
|
],
|
||||||
alias: {
|
alias: {
|
||||||
'fs': path.join(__dirname + '/node_modules', 'html5-fs'),
|
'fs': path.join(__dirname, '../node_modules', 'html5-fs'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
62
dist/orbitdb.min.js
vendored
62
dist/orbitdb.min.js
vendored
File diff suppressed because one or more lines are too long
@ -46,9 +46,9 @@
|
|||||||
"postinstall": "./scripts/post_install.sh",
|
"postinstall": "./scripts/post_install.sh",
|
||||||
"test": "mocha",
|
"test": "mocha",
|
||||||
"build": "npm run build:dist && npm run build:minified && npm run build:examples",
|
"build": "npm run build:dist && npm run build:minified && npm run build:examples",
|
||||||
"build:dist": "./node_modules/.bin/webpack --config webpack.config.js",
|
"build:dist": "./node_modules/.bin/webpack --config conf/webpack.config.js",
|
||||||
"build:minified": "./node_modules/.bin/webpack --config webpack.config.minified.js",
|
"build:minified": "./node_modules/.bin/webpack --config conf/webpack.config.minified.js",
|
||||||
"build:examples": "./node_modules/.bin/webpack --config webpack.example.config.js",
|
"build:examples": "./node_modules/.bin/webpack --config conf/webpack.example.config.js",
|
||||||
"stats": "./node_modules/.bin/webpack --json > stats.json"
|
"stats": "./node_modules/.bin/webpack --json > stats.json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user