Skip to content

Commit 6777924

Browse files
authored
Merge pull request #697 from zeromq/docs
2 parents 22ac490 + 133135f commit 6777924

32 files changed

+1956
-382
lines changed

.eslintrc

+1-6
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,10 @@
1313
"ignorePatterns": [
1414
"node_modules/",
1515
"build/",
16-
"lib/",
16+
"lib/**/*",
1717
"tmp/",
18-
"v5-compat.d.ts",
19-
"draft.d.ts",
20-
"script/*.js",
21-
"script/*.d.ts",
2218
"docs/",
2319
"doc-unminified/",
24-
"test/unit/compat/",
2520
"test/bench/"
2621
]
2722
}

.github/workflows/CI.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ jobs:
212212
max_attempts: 3
213213
shell: bash
214214
command: |
215-
pnpm run test.unit || (rm -rf ./tmp && mkdir -p ./tmp && exit 1)
215+
pnpm run test || (rm -rf ./tmp && mkdir -p ./tmp && exit 1)
216216
rm -rf ./tmp && mkdir -p ./tmp
217217
218218
- name: Test Electron Windows/MacOS

.github/workflows/docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: Build Documentation
6868
run: |
6969
pnpm install
70-
pnpm run build.doc
70+
pnpm run docs.build
7171
7272
- name: Deploy Documentation
7373
uses: Cecilapp/GitHub-Pages-deploy@v3

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/build
2-
/docs
2+
/docs*
33
/lib
44
/tmp
55
node_modules

README.md

+141-139
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@
2828
- [Useful links](#useful-links)
2929
- [Table of contents](#table-of-contents)
3030
- [Installation](#installation)
31-
- [Prebuilt binaries](#prebuilt-binaries)
32-
- [Building from source](#building-from-source)
33-
- [Available Build Options](#available-build-options)
34-
- [Curve with Libsodium support](#curve-with-libsodium-support)
35-
- [Draft support](#draft-support)
36-
- [Websocket support](#websocket-support)
37-
- [Secure Websocket support](#secure-websocket-support)
38-
- [Not Synchronous Resolve](#not-synchronous-resolve)
39-
- [MacOS Deployment Target](#macos-deployment-target)
4031
- [Examples](#examples)
4132
- [Basic Usage](#basic-usage)
4233
- [Push/Pull](#pushpull)
@@ -50,6 +41,15 @@
5041
- [`server.js`](#serverjs)
5142
- [Zeromq 4 and 5 Compatibility layer](#zeromq-4-and-5-compatibility-layer)
5243
- [TypeScript](#typescript)
44+
- [Prebuilt binaries](#prebuilt-binaries)
45+
- [Building from source](#building-from-source)
46+
- [Available Build Options](#available-build-options)
47+
- [Curve with Libsodium support](#curve-with-libsodium-support)
48+
- [Draft support](#draft-support)
49+
- [Websocket support](#websocket-support)
50+
- [Secure Websocket support](#secure-websocket-support)
51+
- [Not Synchronous Resolve](#not-synchronous-resolve)
52+
- [MacOS Deployment Target](#macos-deployment-target)
5353
- [Contribution](#contribution)
5454
- [Dependencies](#dependencies)
5555
- [Defining new options](#defining-new-options)
@@ -67,139 +67,13 @@ npm install zeromq
6767

6868
Supported versions:
6969

70-
- Node.js v12 (requires a [N-API](https://nodejs.org/api/n-api.html))
71-
72-
### Prebuilt binaries
73-
74-
The following platforms have a **prebuilt binary** available:
75-
76-
- Windows on x86/x86-64
77-
78-
Zeromq binaries on Windows 10 or older need
79-
[Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version)
80-
to be installed.
81-
82-
- Linux on x86-64 with libstdc++.so.6.0.21+ (glibc++ 3.4.21+), for example:
83-
- Debian 9+ (Stretch or later)
84-
- Ubuntu 16.04+ (Xenial or later)
85-
- CentOS 8+
86-
- Linux on x86-64 with musl, for example:
87-
- Alpine 3.3+
88-
- MacOS 10.9+ on x86-64
89-
90-
If a prebuilt binary is not available for your platform, installing will attempt
91-
to start a build from source.
92-
93-
### Building from source
94-
95-
If a prebuilt binary is unavailable, or if you want to pass certain options
96-
during build, you can build this package from source.
97-
98-
Make sure you have the following installed before attempting to build from
99-
source:
100-
101-
- Node.js 10+ or Electron
102-
- C++17 compiler toolchain (e.g. LLVM, GCC, MSVC)
103-
- Python 3
104-
- CMake 3.16+
105-
- vcpkg dependencies (e.g. on Linux it needs curl, unzip, zip, tar, git,
106-
pkg-config)
107-
108-
For Curve:
109-
110-
- automake
111-
- autoconf
112-
- libtool
113-
114-
To install from source, specify `build_from_source=true` in a `.npmrc` file
115-
116-
```
117-
build_from_source=true
118-
```
119-
120-
When building from source, you can also specify additional build options in a
121-
`.npmrc` file in your project:
122-
123-
### Available Build Options
124-
125-
<details>
126-
<summary>👉🏻 Options</summary>
127-
128-
### Curve with Libsodium support
129-
130-
(Enabled by default)
131-
132-
Enables CURVE security for encrypted communications. Zeromq uses libsodium for
133-
CURVE security. To enable CURVE support, add the following to your .npmrc:
134-
135-
```ini
136-
zmq_curve="true"
137-
zmq_sodium="true"
138-
```
139-
140-
Building libsodium requires these dependencies on Linux/MacOS:
141-
`autoconf automake libtool`, which can be installed via `apt-get` or `brew`,
142-
etc.
143-
144-
#### Draft support
145-
146-
(Enabled by default)
147-
148-
By default `libzmq` is built with support for `Draft` patterns (e.g.
149-
`server-client`, `radio-dish`, `scatter-gather`). If you want to build `libzmq`
150-
without support for `Draft`, you can specify the following in `.npmrc`:
151-
152-
```ini
153-
zmq_draft=false
154-
```
155-
156-
#### Websocket support
157-
158-
Enables WebSocket transport, allowing ZeroMQ to communicate over WebSockets. To
159-
enable WebSocket support, add the following to your .npmrc:
160-
161-
```ini
162-
zmq_websockets="true"
163-
```
164-
165-
#### Secure Websocket support
166-
167-
Enables WebSocket transport with TLS (wss), providing secure WebSocket
168-
communications. To enable secure WebSocket support, add the following to your
169-
.npmrc:
170-
171-
```ini
172-
zmq_websockets_secure="true"
173-
```
174-
175-
#### Not Synchronous Resolve
176-
177-
Enables immediate send/receive on the socket without synchronous resolution.
178-
This option can improve performance in certain scenarios by allowing operations
179-
to proceed without waiting for synchronous resolution. To enable this feature,
180-
add the following to your `.npmrc`:
181-
182-
```ini
183-
zmq_no_sync_resolve="true"
184-
```
185-
186-
#### MacOS Deployment Target
187-
188-
Specifies the minimum macOS version that the binary will be compatible with.
189-
This is particularly useful when building for different macOS versions. To set
190-
this, add the following to your .npmrc, replacing 10.15 with your desired
191-
minimum macOS version:
192-
193-
```ini
194-
macosx_deployment_target="10.15"
195-
```
196-
197-
</details>
70+
- Node.js v10+ (requires a [N-API](https://nodejs.org/api/n-api.html))
19871

19972
## Examples
20073

20174
Here some examples of different features are provided. More examples can be
202-
found in the [examples directory](examples).
75+
found in the
76+
[examples directory](https://github.com/zeromq/zeromq.js/tree/master/examples).
20377

20478
You can also browse
20579
[the API reference documentation](http://zeromq.github.io/zeromq.js/globals.html)
@@ -423,6 +297,133 @@ _Requirements_
423297
include their corresponding polyfills if needed): `es2015`,
424298
`ESNext.AsyncIterable`
425299

300+
### Prebuilt binaries
301+
302+
The following platforms have a **prebuilt binary** available:
303+
304+
- Windows on x86/x86-64
305+
306+
Zeromq binaries on Windows 10 or older need
307+
[Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version)
308+
to be installed.
309+
310+
- Linux on x86-64 with libstdc++.so.6.0.21+ (glibc++ 3.4.21+), for example:
311+
- Debian 9+ (Stretch or later)
312+
- Ubuntu 16.04+ (Xenial or later)
313+
- CentOS 8+
314+
- Linux on x86-64 with musl, for example:
315+
- Alpine 3.3+
316+
- MacOS 10.9+ on x86-64
317+
318+
If a prebuilt binary is not available for your platform, installing will attempt
319+
to start a build from source.
320+
321+
### Building from source
322+
323+
If a prebuilt binary is unavailable, or if you want to pass certain options
324+
during build, you can build this package from source.
325+
326+
Make sure you have the following installed before attempting to build from
327+
source:
328+
329+
- Node.js 10+ or Electron
330+
- C++17 compiler toolchain (e.g. LLVM, GCC, MSVC)
331+
- Python 3
332+
- CMake 3.16+
333+
- vcpkg dependencies (e.g. on Linux it needs curl, unzip, zip, tar, git,
334+
pkg-config)
335+
336+
For Curve:
337+
338+
- automake
339+
- autoconf
340+
- libtool
341+
342+
To install from source, specify `build_from_source=true` in a `.npmrc` file
343+
344+
```ini
345+
build_from_source=true
346+
```
347+
348+
When building from source, you can also specify additional build options in a
349+
`.npmrc` file in your project:
350+
351+
### Available Build Options
352+
353+
<details>
354+
<summary>👉🏻 Options</summary>
355+
356+
### Curve with Libsodium support
357+
358+
(Enabled by default)
359+
360+
Enables CURVE security for encrypted communications. Zeromq uses libsodium for
361+
CURVE security. To enable CURVE support, add the following to your .npmrc:
362+
363+
```ini
364+
zmq_curve="true"
365+
zmq_sodium="true"
366+
```
367+
368+
Building libsodium requires these dependencies on Linux/MacOS:
369+
`autoconf automake libtool`, which can be installed via `apt-get` or `brew`,
370+
etc.
371+
372+
#### Draft support
373+
374+
(Enabled by default)
375+
376+
By default `libzmq` is built with support for `Draft` patterns (e.g.
377+
`server-client`, `radio-dish`, `scatter-gather`). If you want to build `libzmq`
378+
without support for `Draft`, you can specify the following in `.npmrc`:
379+
380+
```ini
381+
zmq_draft=false
382+
```
383+
384+
#### Websocket support
385+
386+
Enables WebSocket transport, allowing ZeroMQ to communicate over WebSockets. To
387+
enable WebSocket support, add the following to your .npmrc:
388+
389+
```ini
390+
zmq_websockets="true"
391+
```
392+
393+
#### Secure Websocket support
394+
395+
Enables WebSocket transport with TLS (wss), providing secure WebSocket
396+
communications. To enable secure WebSocket support, add the following to your
397+
.npmrc:
398+
399+
```ini
400+
zmq_websockets_secure="true"
401+
```
402+
403+
#### Not Synchronous Resolve
404+
405+
Enables immediate send/receive on the socket without synchronous resolution.
406+
This option can improve performance in certain scenarios by allowing operations
407+
to proceed without waiting for synchronous resolution. To enable this feature,
408+
add the following to your `.npmrc`:
409+
410+
```ini
411+
zmq_no_sync_resolve="true"
412+
```
413+
414+
#### MacOS Deployment Target
415+
416+
Specifies the minimum macOS version that the binary will be compatible with.
417+
This is particularly useful when building for different macOS versions. To set
418+
this, add the following to your .npmrc, replacing 10.15 with your desired
419+
minimum macOS version:
420+
421+
```ini
422+
macosx_deployment_target="10.15"
423+
```
424+
425+
</details>
426+
426427
## Contribution
427428

428429
If you are interested in making contributions to this project, please read the
@@ -520,4 +521,5 @@ first outlined in [this issue](https://github.com/zeromq/zeromq.js/issues/189).
520521
Previous versions of ZeroMQ.js were based on `zmq` and a fork that included
521522
prebuilt binaries.
522523

523-
See detailed changes in the [CHANGELOG](CHANGELOG.md).
524+
See detailed changes in the
525+
[CHANGELOG](https://github.com/zeromq/zeromq.js/releases).

0 commit comments

Comments
 (0)