mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
docs: Using distributed OrbitDB script.
This commit is contained in:
parent
04ec34ad8a
commit
d7cfdf96ed
@ -38,9 +38,9 @@ A Go implementation is developed and maintained by the [Berty](https://github.co
|
||||
<!-- toc -->
|
||||
|
||||
- [Installation](#installation)
|
||||
* [Browser <script> tag](#browser-script-tag)
|
||||
- [Usage](#usage)
|
||||
- [API](#api)
|
||||
- [Database browser UI](#database-browser-ui)
|
||||
- [Examples](#examples)
|
||||
* [Install dependencies](#install-dependencies)
|
||||
* [Browser example](#browser-example)
|
||||
@ -64,6 +64,12 @@ A Go implementation is developed and maintained by the [Berty](https://github.co
|
||||
npm install orbit-db
|
||||
```
|
||||
|
||||
### Browser <script> tag
|
||||
|
||||
OrbitDB can be loaded in the browser using the distributed js file with the `<script/>` tag. OrbitDB is the global namespace and all external functions are available via this namespace:
|
||||
|
||||
`<script>/path/to/orbitdb.min.js</script>`
|
||||
|
||||
## Usage
|
||||
|
||||
If you're using `orbit-db` to develop **browser** or **Node.js** applications, use it as a module with the javascript instance of IPFS.
|
||||
|
@ -7,7 +7,7 @@ export default (env, argv) => {
|
||||
|
||||
return {
|
||||
mode: 'production',
|
||||
entry: './src/orbitdb.js',
|
||||
entry: './src/index.js',
|
||||
output: {
|
||||
filename: '../dist/orbitdb.min.js',
|
||||
library: {
|
||||
|
@ -7,7 +7,7 @@ export default (env, argv) => {
|
||||
|
||||
return {
|
||||
mode: 'development',
|
||||
entry: './src/orbitdb.js',
|
||||
entry: './src/index.js',
|
||||
output: {
|
||||
filename: '../dist/orbitdb.js',
|
||||
library: {
|
||||
|
@ -9,7 +9,7 @@
|
||||
* const ipfs = create()
|
||||
* const orbitdb = await OrbitDB({ ipfs })
|
||||
* const db = await orbitdb.open('my-docs', { Database: Documents({ indexBy: 'myCustomId'} ) }
|
||||
*
|
||||
*
|
||||
* @augments module:Databases~Database
|
||||
*/
|
||||
import Database from '../database.js'
|
||||
|
Loading…
x
Reference in New Issue
Block a user