Skip to content

Commit e12a780

Browse files
committed
edits
1 parent dcf6f77 commit e12a780

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

docs/basics/js/js-ipfs.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ description: "A simple walkthrough of how to perform basic IPFS operations using
55

66
# IPFS in JavaScript
77

8-
This guide aims to walk you through the basics of using IPFS with JavaScript. JS-IPFS is one of multiple [IPFS implementations](../ipfs-implementations.md). You will learn how to install and spawn a node using the available libraries, as well as add, retrieve, read, and remove files. If you are unsure about the meaning of some terms, check out the [glossary](../concepts/glossary.md).
8+
This guide will walk you through the basics of using IPFS with JavaScript. JS-IPFS is one of multiple [IPFS implementations](../ipfs-implementations.md). You will learn how to install and spawn a node using the available libraries, and add, retrieve, read, and remove files. If you are unsure about the meaning of some terms, check out the [glossary](../concepts/glossary.md).
99

1010
::: tip Environment
1111

12-
All instructions and examples shown here were performed and tested on an M1 Mac. However, the IPFS commands are the same on Linux, macOS, and Windows. You will need to know how to navigate your computer's directories from within the CLI. If you're unsure how to use the CLI, we recommend learning how before continuing with this guide.
12+
All instructions and examples shown here were performed and tested on an M1 Mac. However, the IPFS commands are the same on Linux, macOS, and Windows. You will to navigate your computer's directories from within the CLI. If you're unsure how to use the CLI, we recommend learning how before continuing with this guide.
1313

1414
:::
1515

@@ -29,7 +29,7 @@ To use the CLI on your machine, globally install the `ipfs` Node.js package:
2929
npm i --location=global ipfs
3030
```
3131

32-
Alternatively, you can build the project from source. See the [JS-IPFS GitHub repository](https://github.com/ipfs/js-ipfs) for instructions.
32+
Alternatively, you can build the project from the source. See the [JS-IPFS GitHub repository](https://github.com/ipfs/js-ipfs) for instructions.
3333

3434
:::
3535

@@ -43,7 +43,7 @@ To use the IPFS core API, install the `ipfs-core` Node.js package:
4343
npm i ipfs-core
4444
```
4545

46-
Alternatively, you can build the project from source. See the [JS-IPFS GitHub repository](https://github.com/ipfs/js-ipfs) for instructions.
46+
Alternatively, you can build the project from the source. See the [JS-IPFS GitHub repository](https://github.com/ipfs/js-ipfs) for instructions.
4747

4848
:::
4949

@@ -55,13 +55,13 @@ Alternatively, you can build the project from source. See the [JS-IPFS GitHub re
5555

5656
::: tab ipfs-cli id="spawn-ipfs-cli"
5757

58-
1. To spawn a node using the CLI, simply start the daemon:
58+
1. To spawn a node using the CLI, start the daemon:
5959

6060
```bash
6161
jsipfs daemon
6262
```
6363

64-
1. You should see an output similar to:
64+
2. You should see an output similar to:
6565

6666
```shell
6767
Initializing IPFS daemon...
@@ -79,11 +79,11 @@ Alternatively, you can build the project from source. See the [JS-IPFS GitHub re
7979
Daemon is ready
8080
```
8181

82-
1. You should be able to point to the [webpage](http://127.0.0.1:5002/webui) using the address output by the terminal `http://127.0.0.1:5002/webui`:
82+
3. You should be able to point to the [webpage](http://127.0.0.1:5002/webui) using the address output by the terminal `http://127.0.0.1:5002/webui`:
8383

8484
![The JS-IPFS daemon showing the web-ui.](../../images/jsipfs-webui.png)
8585

86-
1. If you are unable to connect to the API, ensure [cross-origin (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) requests are configured:
86+
4. If you are unable to connect to the API, ensure [cross-origin (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) requests are configured:
8787

8888
```bash
8989
jsipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://127.0.0.1:5002", "http://localhost:3000", "http://127.0.0.1:5001", "https://webui.ipfs.io"]'
@@ -158,7 +158,7 @@ Create a simple Node.js application to host the logic that will allow you to use
158158
159159
### Connect to IPFS
160160
161-
The JS-IPFS implementation is split into several Node.js modules. The following section shows examples of how you can use the HTTP client to connect to IPFS. For more information on the different modules, examine the [API Packages table](../../reference/js/api.md##packages)
161+
The JS-IPFS implementation is split into several Node.js modules. The following section shows examples of using the HTTP client to connect to IPFS. For more information on the different modules, examine the [API Packages table](../../reference/js/api.md##packages)
162162
163163
:::: tabs
164164
@@ -198,7 +198,7 @@ The library internally detects if your machine is running a local node.
198198
npm i ipfs-client
199199
```
200200
201-
2. Populate your `index.js` file with the following to create an instance of the HTTP API client:
201+
1. Populate your `index.js` file with the following to create an instance of the HTTP API client:
202202
203203
```js{1,3-5}
204204
import { create } from 'ipfs-client'
@@ -213,7 +213,7 @@ The library internally detects if your machine is running a local node.
213213
214214
This imports the client library and uses the `create()` function to define the server endpoints.
215215
216-
3. To connect to the endpoints, run the application:
216+
1. To connect to the endpoints, run the application:
217217
218218
```bash
219219
node index.js
@@ -231,29 +231,29 @@ Now you can start to add files using JS-IPFS to the IPFS network.
231231
232232
::: warning Section changes coming soon
233233
234-
As the JS-IPFS implementation goes through changes, the steps to add a file are likely to change. Please reference the [source packages](https://github.com/ipfs/js-ipfs) for the latest updates.
234+
As the JS-IPFS implementation changes, some of these steps should be deemed conditional. Please reference the [source packages](https://github.com/ipfs/js-ipfs) for the latest updates.
235235
236236
:::
237237
238238
:::: tabs
239239
240240
::: tab ipfs-cli id="add-ipfs-cli"
241241
242-
1. In a new session, navigate to the directory you wish to add a file from. You can also specify the file path when using the cli to add a file.
243-
1. The daemon uses an `ADD` method to request data from IPFS; `jsipfs add`. We will use a test file called `test.txt` to add through the jsipfs daemon.
242+
1. In a new session, navigate to the directory from which you wish to add a file. You can also specify the file path when using the cli to add a file.
243+
2. The daemon uses an `ADD` method to request data from IPFS; `jsipfs add`. We will use a test file called `test.txt` to add through the jsipfs daemon.
244244
245245
```bash
246246
jsipfs add ./test.txt
247247
```
248248
249-
1. You should obtain a result that verifies the file was added and returns the CID:
249+
3. You should obtain a result that verifies the file was added and returns the CID:
250250
251251
```shell
252252
added QmWcYcWY5vdDzBcAoLo3rYXQ2tLkjzu57vEePCvyhuwZRi test.txt
253253
```
254254
255-
1. The file has been added to the IPFS network and has given the file a CID. You can share this CID with anyone, and they can use it on their IPFS node to obtain the content you uploaded.
256-
1. To view the file contents, navigate to the [webui](http://127.0.0.1:5002/webui) and provide the CID on the search bar. The UI will provide the file contents, similar to the following:
255+
4. The file has been added to the IPFS network and has given the file a CID. You can share this CID with anyone, and they can use it on their IPFS node to obtain the content you uploaded.
256+
5. To view the file contents, navigate to the [webui](http://127.0.0.1:5002/webui) and provide the CID on the search bar. The UI will provide the file contents, similar to the following:
257257
258258
![](../../images/jsipfs-add-webui.png)
259259
@@ -424,7 +424,7 @@ Removing the content pin will remove a file from IPFS. In this section, we will
424424
unpinned QmWcYcWY5vdDzBcAoLo3rYXQ2tLkjzu57vEePCvyhuwZRi
425425
```
426426

427-
1. `test.txt` file is now unpinned, but it has not been removed from our node completely. To remove it completely, we need to run the [garbage collection](../../concepts/persistence##garbage-collection). The command will remove everything from your node that does not have a pin:
427+
1. `test.txt` file is now unpinned, but it has not been removed from our node completely. To remove it completely, run the [garbage collection](../../concepts/persistence##garbage-collection). The command will remove everything from your node that does not have a pin:
428428

429429
```shell
430430
jsipfs repo gc
@@ -439,7 +439,7 @@ Removing the content pin will remove a file from IPFS. In this section, we will
439439
[...]
440440
```
441441

442-
1. The target file has now been fully removed from your IPFS node and any other files that we did not pin. If the content that was just garbage collected was saved to your computer's local storage, it is still there. If you wish to remove the content from your computer's local storage, you will need to find where it is saved and delete it using the normal deletion method.
442+
2. The target file has now been removed from your IPFS node and other files that were not pinned. If the content that was just garbage collected was saved to your computer's local storage, it is still there. If you wish to remove the content from your computer's local storage, you will need to find where it is saved and delete it using the normal deletion method.
443443

444444
::: tip
445445

0 commit comments

Comments
 (0)