lightdrift-libraw 1.0.0-alpha.3 → 1.0.0-alpha.5
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 +78 -13
- package/binding.gyp +48 -18
- package/lib/index.d.ts +636 -630
- package/lib/index.js +15 -1
- package/package.json +41 -38
package/README.md
CHANGED
|
@@ -59,14 +59,87 @@ npm install lightdrift-libraw
|
|
|
59
59
|
|
|
60
60
|
**Version 1.0.0-alpha.3** is now available on [npmjs.com](https://www.npmjs.com/package/lightdrift-libraw)! 🎉
|
|
61
61
|
|
|
62
|
-
### 🛠️
|
|
62
|
+
### 🛠️ System Requirements
|
|
63
|
+
|
|
64
|
+
#### **Windows**
|
|
65
|
+
|
|
66
|
+
- **Node.js** 14.0.0 or higher
|
|
67
|
+
- **Python** 3.6+ (for node-gyp)
|
|
68
|
+
- **Visual Studio Build Tools** 2019+ or Visual Studio Community
|
|
69
|
+
- LibRaw is bundled (no additional dependencies needed)
|
|
70
|
+
|
|
71
|
+
#### **Linux (Alpine/Debian/Ubuntu)**
|
|
63
72
|
|
|
64
73
|
- **Node.js** 14.0.0 or higher
|
|
65
74
|
- **Python** 3.6+ (for node-gyp)
|
|
66
|
-
- **
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
- **LibRaw development package**:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Alpine
|
|
79
|
+
apk add libraw-dev build-base
|
|
80
|
+
|
|
81
|
+
# Debian/Ubuntu
|
|
82
|
+
apt-get install libraw-dev build-essential
|
|
83
|
+
|
|
84
|
+
# Then install the package
|
|
85
|
+
npm install lightdrift-libraw
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
#### **macOS**
|
|
89
|
+
|
|
90
|
+
- **Node.js** 14.0.0 or higher
|
|
91
|
+
- **Xcode Command Line Tools**: `xcode-select --install`
|
|
92
|
+
- **LibRaw**:
|
|
93
|
+
```bash
|
|
94
|
+
brew install libraw
|
|
95
|
+
npm install lightdrift-libraw
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 🐳 Docker Usage
|
|
99
|
+
|
|
100
|
+
When using Docker or pnpm, you may need to explicitly rebuild native modules:
|
|
101
|
+
|
|
102
|
+
```dockerfile
|
|
103
|
+
FROM node:18-alpine
|
|
104
|
+
|
|
105
|
+
# Install system dependencies
|
|
106
|
+
RUN apk add --no-cache \
|
|
107
|
+
python3 \
|
|
108
|
+
make \
|
|
109
|
+
g++ \
|
|
110
|
+
libraw-dev
|
|
111
|
+
|
|
112
|
+
WORKDIR /app
|
|
113
|
+
|
|
114
|
+
# Copy package files
|
|
115
|
+
COPY package*.json ./
|
|
116
|
+
|
|
117
|
+
# Install dependencies
|
|
118
|
+
RUN npm install --frozen-lockfile
|
|
119
|
+
|
|
120
|
+
# Explicitly rebuild native module
|
|
121
|
+
RUN npm rebuild lightdrift-libraw
|
|
122
|
+
|
|
123
|
+
# Copy application
|
|
124
|
+
COPY . .
|
|
125
|
+
|
|
126
|
+
CMD ["node", "app.js"]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### **pnpm in Docker**
|
|
130
|
+
|
|
131
|
+
If using pnpm, add `.npmrc` to your project:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
enable-pre-post-scripts=true
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Or rebuild manually:
|
|
138
|
+
|
|
139
|
+
```dockerfile
|
|
140
|
+
RUN pnpm install --frozen-lockfile
|
|
141
|
+
RUN pnpm rebuild lightdrift-libraw
|
|
142
|
+
```
|
|
70
143
|
|
|
71
144
|
### 🚀 Quick Verification
|
|
72
145
|
|
|
@@ -78,14 +151,6 @@ node -e "const LibRaw = require('lightdrift-libraw'); console.log('LibRaw versio
|
|
|
78
151
|
|
|
79
152
|
Expected output: `LibRaw version: 0.21.4-Release`
|
|
80
153
|
|
|
81
|
-
## Prerequisites (for building from source)
|
|
82
|
-
|
|
83
|
-
- **Node.js** 14.0.0 or higher
|
|
84
|
-
- **Python** 3.x (for node-gyp)
|
|
85
|
-
- **Visual Studio Build Tools** (Windows)
|
|
86
|
-
- **Xcode Command Line Tools** (macOS)
|
|
87
|
-
- **build-essential** (Linux)
|
|
88
|
-
|
|
89
154
|
## Quick Start
|
|
90
155
|
|
|
91
156
|
```javascript
|
package/binding.gyp
CHANGED
|
@@ -7,31 +7,61 @@
|
|
|
7
7
|
"src/libraw_wrapper.cpp"
|
|
8
8
|
],
|
|
9
9
|
"include_dirs": [
|
|
10
|
-
"<!@(node -p \"require('node-addon-api').include\")"
|
|
11
|
-
"deps/LibRaw-Win64/LibRaw-0.21.4/libraw",
|
|
12
|
-
"deps/LibRaw-Win64/LibRaw-0.21.4"
|
|
13
|
-
],
|
|
14
|
-
"libraries": [
|
|
15
|
-
"<(module_root_dir)/deps/LibRaw-Win64/LibRaw-0.21.4/lib/libraw.lib"
|
|
10
|
+
"<!@(node -p \"require('node-addon-api').include\")"
|
|
16
11
|
],
|
|
17
12
|
"defines": [
|
|
18
13
|
"NAPI_DISABLE_CPP_EXCEPTIONS"
|
|
19
14
|
],
|
|
20
15
|
"cflags!": [ "-fno-exceptions" ],
|
|
21
16
|
"cflags_cc!": [ "-fno-exceptions" ],
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
17
|
+
"conditions": [
|
|
18
|
+
['OS=="win"', {
|
|
19
|
+
"include_dirs": [
|
|
20
|
+
"deps/LibRaw-Win64/LibRaw-0.21.4/libraw",
|
|
21
|
+
"deps/LibRaw-Win64/LibRaw-0.21.4"
|
|
22
|
+
],
|
|
23
|
+
"libraries": [
|
|
24
|
+
"<(module_root_dir)/deps/LibRaw-Win64/LibRaw-0.21.4/lib/libraw.lib"
|
|
25
|
+
],
|
|
26
|
+
"msvs_settings": {
|
|
27
|
+
"VCCLCompilerTool": {
|
|
28
|
+
"ExceptionHandling": 1,
|
|
29
|
+
"RuntimeLibrary": 2
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"copies": [
|
|
33
|
+
{
|
|
34
|
+
"destination": "<(module_root_dir)/build/Release/",
|
|
35
|
+
"files": [
|
|
36
|
+
"<(module_root_dir)/deps/LibRaw-Win64/LibRaw-0.21.4/bin/libraw.dll"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
33
39
|
]
|
|
34
|
-
}
|
|
40
|
+
}],
|
|
41
|
+
['OS=="linux"', {
|
|
42
|
+
"include_dirs": [
|
|
43
|
+
"/usr/include",
|
|
44
|
+
"/usr/local/include",
|
|
45
|
+
"/usr/include/libraw"
|
|
46
|
+
],
|
|
47
|
+
"libraries": ["-lraw"],
|
|
48
|
+
"cflags": ["-fexceptions"],
|
|
49
|
+
"cflags_cc": ["-fexceptions"]
|
|
50
|
+
}],
|
|
51
|
+
['OS=="mac"', {
|
|
52
|
+
"include_dirs": [
|
|
53
|
+
"/usr/local/include",
|
|
54
|
+
"/usr/local/include/libraw",
|
|
55
|
+
"/opt/homebrew/include",
|
|
56
|
+
"/opt/homebrew/include/libraw"
|
|
57
|
+
],
|
|
58
|
+
"libraries": ["-lraw"],
|
|
59
|
+
"xcode_settings": {
|
|
60
|
+
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
|
|
61
|
+
"CLANG_CXX_LIBRARY": "libc++",
|
|
62
|
+
"MACOSX_DEPLOYMENT_TARGET": "10.9"
|
|
63
|
+
}
|
|
64
|
+
}]
|
|
35
65
|
]
|
|
36
66
|
}
|
|
37
67
|
]
|