diff --git a/examples/electron/README.md b/examples/electron/README.md index 60713b84a3..baecfb99a1 100755 --- a/examples/electron/README.md +++ b/examples/electron/README.md @@ -1,5 +1,16 @@ # js-ipfs in Electron -This example is heavily inspired by [electron-quick-start](https://github.com/electron/electron-quick-start). +> This example is heavily inspired by [electron-quick-start](https://github.com/electron/electron-quick-start). -Simply `npm install` and `npm start` to see it working. +**DISCLAIMER:** This example is still a work in progress, it currently doesn't work due to the usage of native dependencies that Electron is not supporting. + +To try it by yourself, do: + +``` +> npm install +> ./node_modules/.bin/electron-rebuild +# or +> ./build.sh +# +# You can also try to use `npm start` to see where electron errors +``` diff --git a/examples/electron/build.sh b/examples/electron/build.sh new file mode 100644 index 0000000000..9d31134360 --- /dev/null +++ b/examples/electron/build.sh @@ -0,0 +1,13 @@ +# Electron's version. +export npm_config_target=1.6.11 +# The architecture of Electron, can be ia32 or x64. +export npm_config_arch=x64 +export npm_config_target_arch=x64 +# Download headers for Electron. +export npm_config_disturl=https://atom.io/download/electron +# Tell node-pre-gyp that we are building for Electron. +export npm_config_runtime=electron +# Tell node-pre-gyp to build module from source code. +export npm_config_build_from_source=true +# Install all dependencies, and store cache to ~/.electron-gyp. +HOME=~/.electron-gyp npm install