Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 5098532

Browse files
committed
docs(examples): small tweaks
1 parent 88aeef4 commit 5098532

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

examples/basics/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22

33
const fs = require('fs')
44
const os = require('os')
5+
const path = require('path')
56
const series = require('async/series')
6-
const IPFS = require('../../src/core') // replace this by line below
7+
const IPFS = require('../../src/core')
8+
// replace this by line below if you are using ipfs as a dependency of your
9+
// project
710
// const IPFS = require('ipfs')
811

912
/*
1013
* Create a new IPFS instance, using default repo (fs) on default path (~/.ipfs)
1114
*/
12-
const node = new IPFS(os.tmpDir() + '/' + new Date().toString())
15+
const node = new IPFS(path.join(os.tmpDir() + '/' + new Date().toString()))
1316

1417
const fileToAdd = {
1518
path: 'hello.txt',

examples/bundle-browserify/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ You should see the following:
1919
## Special note
2020

2121
In order to use js-ipfs in the browser, you need to replace the default `zlib` library by `browserify-zlib-next`, a full implementation of the native `zlib` package, full in Node.js.
22-
See the package.json to learn how to do this and avoid this pitfall. More context on: https://github.com/ipfs/js-ipfs#use-in-the-browser-with-browserify-webpack-or-any-bundler
22+
See the package.json to learn how to do this and avoid this pitfall (see the `browser` key). More context on: https://github.com/ipfs/js-ipfs#use-in-the-browser-with-browserify-webpack-or-any-bundler

0 commit comments

Comments
 (0)