Skip to content

Commit 1cd51ea

Browse files
committed
Updated README.md
- various improvements to fix typos or to make things clearer to readers
1 parent 6deff3c commit 1cd51ea

File tree

1 file changed

+14
-28
lines changed

1 file changed

+14
-28
lines changed

README.md

+14-28
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Asynchronous, non-blocking [SQLite3](https://sqlite.org/) bindings for [Node.js]
2323

2424
You can use [`npm`](https://github.com/npm/cli) or [`yarn`](https://github.com/yarnpkg/yarn) to install `sqlite3`:
2525

26-
* (recommended) Latest package:
26+
* (recommended) Latest published package:
2727
```bash
2828
npm install sqlite3
2929
# or
@@ -121,35 +121,21 @@ Note, if building against homebrew-installed sqlite on OS X you can do:
121121
npm install --build-from-source --sqlite=/usr/local/opt/sqlite/
122122
```
123123

124-
By default the node-gyp install will use `python` as part of the installation. A
125-
different python executable can be specified on the command line.
126-
127-
```bash
128-
npm install --build-from-source --python=/usr/bin/python2
129-
```
124+
## Custom file header (magic)
130125

131-
This uses the npm_config_python config, so values in .npmrc will be honoured:
126+
The default sqlite file header is "SQLite format 3". You can specify a different magic, though this will make standard tools and libraries unable to work with your files.
132127

133128
```bash
134-
python=/usr/bin/python2
129+
npm install --build-from-source --sqlite_magic="MyCustomMagic15"
135130
```
136131

137-
## Custom file header (magic)
138-
139-
The default sqlite file header is "SQLite format 3".
140-
You can specify a different magic, though this will make standard tools and libraries unable to work with your files.
141-
142-
143-
npm install --build-from-source --sqlite_magic="MyCustomMagic15"
144-
145-
146132
Note that the magic *must* be exactly 15 characters long (16 bytes including null terminator).
147133

148134
## Building for node-webkit
149135

150136
Because of ABI differences, `sqlite3` must be built in a custom to be used with [node-webkit](https://github.com/rogerwang/node-webkit).
151137

152-
To build node-sqlite3 for node-webkit:
138+
To build `sqlite3` for node-webkit:
153139

154140
1. Install [`nw-gyp`](https://github.com/rogerwang/nw-gyp) globally: `npm install nw-gyp -g` *(unless already installed)*
155141

@@ -162,7 +148,7 @@ npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32
162148

163149
This command internally calls out to [`node-pre-gyp`](https://github.com/mapbox/node-pre-gyp) which itself calls out to [`nw-gyp`](https://github.com/rogerwang/nw-gyp) when the `--runtime=node-webkit` option is passed.
164150

165-
You can also run this command from within a `node-sqlite3` checkout:
151+
You can also run this command from within a `sqlite3` checkout:
166152

167153
```bash
168154
npm install --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$(NODE_WEBKIT_VERSION)
@@ -179,19 +165,17 @@ Visit the “[Using Node modules](https://github.com/rogerwang/node-webkit/wiki/
179165

180166
## Building for SQLCipher
181167

182-
For instructions for building sqlcipher see
183-
[Building SQLCipher for node.js](https://coolaj86.com/articles/building-sqlcipher-for-node-js-on-raspberry-pi-2/)
168+
For instructions on building SQLCipher, see [Building SQLCipher for Node.js](https://coolaj86.com/articles/building-sqlcipher-for-node-js-on-raspberry-pi-2/). Alternatively, you can install it with your local package manager.
184169

185-
To run node-sqlite3 against sqlcipher you need to compile from source by passing build options like:
170+
To run against SQLCipher, you need to compile `sqlite3` from source by passing build options like:
186171

187172
```bash
188173
npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/
189174

190175
node -e 'require("sqlite3")'
191176
```
192177

193-
If your sqlcipher is installed in a custom location (if you compiled and installed it yourself),
194-
you'll also need to to set some environment variables:
178+
If your SQLCipher is installed in a custom location (if you compiled and installed it yourself), you'll need to set some environment variables:
195179

196180
### On OS X with Homebrew
197181

@@ -220,14 +204,16 @@ node -e 'require("sqlite3")'
220204

221205
### Custom builds and Electron
222206

223-
Running sqlite3 through [electron-rebuild](https://github.com/electron/electron-rebuild) does not preserve the sqlcipher extension, so some additional flags are needed to make this build Electron compatible. Your `npm install sqlite3 --build-from-source` command needs these additional flags (be sure to replace the target version with the current Electron version you are working with):
207+
Running `sqlite3` through [electron-rebuild](https://github.com/electron/electron-rebuild) does not preserve the SQLCipher extension, so some additional flags are needed to make this build Electron compatible. Your `npm install sqlite3 --build-from-source` command needs these additional flags (be sure to replace the target version with the current Electron version you are working with):
224208

225-
--runtime=electron --target=1.7.6 --dist-url=https://electronjs.org/headers
209+
```bash
210+
--runtime=electron --target=18.2.1 --dist-url=https://electronjs.org/headers
211+
```
226212

227213
In the case of MacOS with Homebrew, the command should look like the following:
228214

229215
```bash
230-
npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix` --runtime=electron --target=1.7.6 --dist-url=https://electronjs.org/headers
216+
npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix` --runtime=electron --target=18.2.1 --dist-url=https://electronjs.org/headers
231217
```
232218

233219
# Testing

0 commit comments

Comments
 (0)