https://github.com/ipfs/js-datastore-s3
Datastore implementation with S3 backend
https://github.com/ipfs/js-datastore-s3
Last synced: 9 months ago
JSON representation
Datastore implementation with S3 backend
- Host: GitHub
- URL: https://github.com/ipfs/js-datastore-s3
- Owner: ipfs
- License: other
- Archived: true
- Created: 2018-04-04T15:40:33.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-23T17:10:25.000Z (about 3 years ago)
- Last Synced: 2024-10-29T12:11:39.923Z (over 1 year ago)
- Language: TypeScript
- Size: 1.3 MB
- Stars: 71
- Watchers: 25
- Forks: 33
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ⛔️ This module is now part of https://github.com/ipfs/js-stores
# datastore-s3
[](https://ipfs.tech)
[](https://discuss.ipfs.tech)
[](https://codecov.io/gh/ipfs/js-datastore-s3)
[](https://github.com/ipfs/js-datastore-s3/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
> IPFS datastore implementation backed by s3
## Table of contents
- [Install](#install)
- [Browser `` tag](#browser-script-tag)
- [Usage](#usage)
- [Create a Repo](#create-a-repo)
- [Examples](#examples)
- [License](#license)
- [Contribute](#contribute)
## Install
```console
$ npm i datastore-s3
```
### Browser `<script>` tag
Loading this module through a script tag will make it's exports available as `DatastoreS3` in the global namespace.
```html
<script src="https://unpkg.com/datastore-s3/dist/index.min.js">
```
## Usage
If the flag `createIfMissing` is not set or is false, then the bucket must be created prior to using datastore-s3. Please see the AWS docs for information on how to configure the S3 instance. A bucket name is required to be set at the s3 instance level, see the below example.
```js
import S3 from 'aws-sdk/clients/s3.js'
import { S3Datastore } from 'datastore-s3'
const s3Instance = new S3({ params: { Bucket: 'my-ipfs-bucket' } })
const store = new S3Datastore('.ipfs/datastore', {
s3: s3Instance
createIfMissing: false
})
```
### Create a Repo
See [examples/full-s3-repo](./examples/full-s3-repo) for how to quickly create an S3 backed repo using the `createRepo` convenience function.
### Examples
You can see examples of S3 backed ipfs in the [examples folder](examples/)
## License
Licensed under either of
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / )
- MIT ([LICENSE-MIT](LICENSE-MIT) / )
## Contribute
Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-datastore-s3/issues).
Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.
Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
[](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)