@helia/http 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,4 @@
1
+ This project is dual licensed under MIT and Apache-2.0.
2
+
3
+ MIT: https://www.opensource.org/licenses/mit
4
+ Apache-2.0: https://www.apache.org/licenses/license-2.0
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ <p align="center">
2
+ <a href="https://github.com/ipfs/helia-http" title="helia-http">
3
+ <img src="https://raw.githubusercontent.com/ipfs/helia/main/assets/helia.png" alt="Helia logo" width="300" />
4
+ </a>
5
+ </p>
6
+
7
+ [![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
8
+ [![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
9
+ [![codecov](https://img.shields.io/codecov/c/github/ipfs/helia.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia)
10
+ [![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia/main.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia/actions/workflows/main.yml?query=branch%3Amain)
11
+
12
+ > A lightweight implementation of IPFS over HTTP in JavaScript
13
+
14
+ # About
15
+
16
+ Exports a `createHeliaHTTP` function that returns an object that implements a lightweight version of the Helia API that functions only over HTTP.
17
+
18
+ Pass it to other modules like @helia/unixfs to fetch files from the distributed web.
19
+
20
+ ## Example
21
+
22
+ ```typescript
23
+ import { createHeliaHTTP } from '@helia/http'
24
+ import { unixfs } from '@helia/unixfs'
25
+ import { CID } from 'multiformats/cid'
26
+
27
+ const helia = await createHeliaHTTP()
28
+
29
+ const fs = unixfs(helia)
30
+ fs.cat(CID.parse('bafyFoo'))
31
+ ```
32
+
33
+ # Install
34
+
35
+ ```console
36
+ $ npm i @helia/http
37
+ ```
38
+
39
+ ## Browser `<script>` tag
40
+
41
+ Loading this module through a script tag will make it's exports available as `HeliaHttp` in the global namespace.
42
+
43
+ ```html
44
+ <script src="https://unpkg.com/@helia/http/dist/index.min.js"></script>
45
+ ```
46
+
47
+ # Helia-http
48
+
49
+ # API Docs
50
+
51
+ - <https://ipfs.github.io/helia/modules/_helia_http.html>
52
+
53
+ # License
54
+
55
+ Licensed under either of
56
+
57
+ - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
58
+ - MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
59
+
60
+ # Contribute
61
+
62
+ Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia/issues).
63
+
64
+ 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.
65
+
66
+ 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).
67
+
68
+ 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.
69
+
70
+ [![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)