UNPKG

2.6 kBMarkdownView Raw
1# Overview
2
3This directory is used for building the [node-oracledb npm
4package](https://www.npmjs.com/package/oracledb). The scripts can also be used
5to create a custom package for hosting on a local server.
6
7Most users do not need to use anything in this directory.
8
9# Building an Install Package
10
11In a clone or copy of the repository:
12
13- If you want to build a package that installs node-oracledb with both 'Thin'
14 and 'Thick' modes, then run `npm run buildbinary`. This calls
15 `buildbinary.js` to create a node-oracledb 'Thick' mode binary for the
16 current operating system. Depending on how Node.js was installed, you may
17 need to run `npm install node-gyp -g` first.
18
19 You can run `npm run buildbinary` on each operating system architecture that
20 you want to include in your package. Copy the node-oracledb Thick mode
21 binaries and related build metadata information files from all
22 `package/Staging` directories to the `package/Staging` directory on one
23 machine.
24
25- On the machine with any (or no) desired Thick mode binaries in
26 `package/Staging`, run `npm run buildpackage`. This calls `buildpackage.js`
27 to make the node-oracledb package containing the node-oracledb JavaScript
28 files, the available Thick mode binaries, and a `package.json` that has
29 `install` and `prune` script targets. The package will be created in the top
30 level directory. It can be uploaded to npmjs.com by maintainers of
31 node-oracledb, or you can upload to your own local server and then use it as
32 a dependency in your projects.
33
34# Package Installation
35
36- Running `npm install` with the created package always installs node-oracledb
37 Thin mode. The installation script also runs `install.js` to check the
38 availability of the optional Thick mode binary module. A warning will be
39 displayed if the binary is not found for the current Node.js version and
40 operating system architecture.
41
42- If you are space-conscious, then run `npm run prune` after installation.
43 This removes pre-built binaries for all other architectures.
44
45 If you only ever want Thin mode, then remove all the Thick mode binaries by
46 running `npm run prune all`.
47
48Note the
49[`package.json`](https://github.com/oracle/node-oracledb/blob/main/package.json)
50in GitHub doesn't have an `install` script target by default. This means that
51node-gyp will be invoked to compile the optional node-oracledb Thick mode
52binary. This allows installation of Thick mode from GitHub [source
53code](https://node-oracledb.readthedocs.io/en/latest/user_guide/installation.html#github)
54when no suitable pre-built binary is available.