linenoise.c 2.2026.1 → 2.2026.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -17
- package/linenoise/linenoise.c +1762 -1762
- package/linenoise/linenoise.h +114 -114
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ Send feedbacks to antirez at gmail
|
|
|
62
62
|
|
|
63
63
|
Run:
|
|
64
64
|
|
|
65
|
-
```
|
|
65
|
+
```bash
|
|
66
66
|
$ npm i linenoise.c
|
|
67
67
|
```
|
|
68
68
|
|
|
@@ -70,32 +70,24 @@ And then include `linenoise.h` as follows:
|
|
|
70
70
|
|
|
71
71
|
```c
|
|
72
72
|
// main.c
|
|
73
|
-
#
|
|
73
|
+
#define LINENOISE_IMPLEMENTATION
|
|
74
|
+
#include <linenoise.h>
|
|
74
75
|
|
|
75
76
|
int main() { /* ... */ }
|
|
76
77
|
```
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
Finally, compile while adding the path `node_modules/linenoise.c` to your compiler's include paths.
|
|
79
80
|
|
|
80
81
|
```bash
|
|
81
|
-
$ clang main.c # or, use gcc
|
|
82
|
-
$ gcc main.c
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
You may also use a simpler approach:
|
|
86
|
-
|
|
87
|
-
```c
|
|
88
|
-
// main.c
|
|
89
|
-
#include <linenoise.h>
|
|
90
|
-
|
|
91
|
-
int main() { /* ... */ }
|
|
82
|
+
$ clang -I./node_modules/linenoise.c main.c # or, use gcc
|
|
83
|
+
$ gcc -I./node_modules/linenoise.c main.c
|
|
92
84
|
```
|
|
93
85
|
|
|
94
|
-
|
|
86
|
+
You may also use a simpler approach with the [cpoach](https://www.npmjs.com/package/cpoach.sh) tool, which automatically adds the necessary include paths of all the installed dependencies for your project.
|
|
95
87
|
|
|
96
88
|
```bash
|
|
97
|
-
$ clang
|
|
98
|
-
$ gcc
|
|
89
|
+
$ cpoach clang main.c # or, use gcc
|
|
90
|
+
$ cpoach gcc main.c
|
|
99
91
|
```
|
|
100
92
|
|
|
101
93
|
|
|
@@ -425,6 +417,7 @@ This approach tests linenoise as users actually experience it, catching renderin
|
|
|
425
417
|
<br>
|
|
426
418
|
|
|
427
419
|
|
|
420
|
+
[](https://wolfram77.github.io)<br>
|
|
428
421
|
[](https://github.com/antirez/linenoise)
|
|
429
422
|
[](https://nodef.github.io)
|
|
430
423
|

|